Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op: rendering,blending #1835

Open
kainino0x opened this issue Sep 13, 2022 · 7 comments
Open

op: rendering,blending #1835

kainino0x opened this issue Sep 13, 2022 · 7 comments
Assignees

Comments

@kainino0x
Copy link
Collaborator

No description provided.

@kainino0x
Copy link
Collaborator Author

This item refers to api/operation/rendering/blending.ts.
That file is partly implemented, but has a number of "unimplemented" tests at the bottom. These need to be fleshed out and implemented:
https://github.com/gpuweb/cts/blob/main/src/webgpu/api/operation/rendering/blending.spec.ts#L277

Example: formats : "Test blending results works for all formats that support it, and that blending is not applied for formats that do not. Blending should be done in linear space for srgb formats."

This description needs to be updated - it's a validation error to attempt to use blending with a format that doesn't support it. (We should check we have a validation test for that before deleting it from this test description.)

This test would:

  • Set up a basic render pipeline like this one, with some basic blend states, for example { operation: "add", srcFactor: "one", dstFactor: "one" } which should simply add the output of the fragment shader to the value currently in the buffer. From the fragment shader, output some value, like (0.4, 0.4, 0.4, 0.4).
  • Set up a simple render pass with loadOp: "clear" and clearValue set to some value, like (0.2, 0.2, 0.2, 0.2).
  • Ensure that the buffer contains the expected value, in this case would be (0.6, 0.6, 0.6, 0.6). Use a helper like textureContentIsOKByT2B to test the result with some error tolerance, because different formats will have different precisions. To start, try something like { maxDiffULPsForNormFormat: 1, maxDiffULPsForFloatFormat: 1 } but you will likely need to increase the tolerance, at least for maxDiffULPsForFloatFormat.

You can ignore the srgb formats thing for the moment, it should hopefully "just work" when you use textureContentIsOKByT2B.

Some documentation here https://gpuweb.github.io/cts/docs/tsdoc/functions/webgpu_util_texture_texture_ok.textureContentIsOKByT2B.html

Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Sep 15, 2022
This PR ensures that blending results work with supported formats.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Sep 17, 2022
This PR ensures that blending results work with supported formats.

Issue: gpuweb#1835
Gyuyoung added a commit that referenced this issue Sep 20, 2022
This PR ensures that blending results work with supported formats.

Issue: #1835
@Gyuyoung
Copy link
Collaborator

Gyuyoung commented Nov 1, 2022

@kainino0x Regarding clamp,blend_foo tests, I'm not clear what the fixed-point formats are, and how to list them up like kBlendableFormats[1]. In other words, I couldn't find what formats are the 'fixed-point' formats because it looks like there are no hints about fixed-point format in the tests.

[1] https://github.com/gpuweb/cts/blob/main/src/webgpu/api/operation/rendering/blending.spec.ts#L284

@kainino0x
Copy link
Collaborator Author

"fixed-point" refers to the unorm and snorm formats. We don't usually use that terminology so let's remove it and refer to unorm/snorm instead.

@Gyuyoung
Copy link
Collaborator

Gyuyoung commented Nov 3, 2022

"fixed-point" refers to the unorm and snorm formats. We don't usually use that terminology so let's remove it and refer to unorm/snorm instead.

ok, then let me update the terminology with unorm/snorm in the PR.

Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 8, 2022
This PR implements 'clamp,blend_color' test to ensure that
the blend color is clamped in the blend equation.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 9, 2022
…ing.spec.ts

This PR implements a new test to ensure the initial blending color is correctly
set at the beginning of every sub passes.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 9, 2022
…ing.spec.ts

This PR implements a new test to ensure the initial blending color is correctly
set at the beginning of every sub-pass.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 9, 2022
…ing.spec.ts

This PR implements a new test to ensure the initial blending color is correctly
set at the beginning of every sub-pass.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 10, 2022
…ing.spec.ts

This PR implements a new test to ensure the initial blending color is correctly
set at the beginning of every sub-pass.

Issue: gpuweb#1835
Gyuyoung added a commit that referenced this issue Nov 10, 2022
…ing.spec.ts (#1980)

This PR implements a new test to ensure the initial blending color is correctly
set at the beginning of every sub-pass.

Issue: #1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 10, 2022
… blending.spec.ts

This PR implements a new test to ensure that setting the blending constant works
correctly.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 10, 2022
… blending.spec.ts

This PR implements a new test to ensure that setting the blending constant works
correctly.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 11, 2022
…blending.spec.ts

This PR implements a new test to ensure that setting the blending constant works
correctly.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 11, 2022
…blending.spec.ts

This PR implements a new test to ensure that setting the blending constant works
correctly.

Issue: gpuweb#1835
Gyuyoung added a commit that referenced this issue Nov 11, 2022
…blending.spec.ts (#1984)

This PR implements a new test to ensure that setting the blending constant works
correctly.

Issue: #1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 11, 2022
… blending.spec.ts

This PR implements a new test to ensure that setting the blending constant works
correctly.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 11, 2022
…in blending.spec.ts

This PR implements a new test to ensure the blending constant is not inherited
between render passes.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 11, 2022
…in blending.spec.ts

This PR implements a new test to ensure the blending constant is not inherited
between render passes.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 15, 2022
…in blending.spec.ts

This PR implements a new test to ensure the blending constant is not inherited
between render passes.

Issue: gpuweb#1835
Gyuyoung added a commit that referenced this issue Nov 15, 2022
…in blending.spec.ts (#1987)

This PR implements a new test to ensure the blending constant is not inherited
between render passes.

Issue: #1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 17, 2022
This PR adds a new test to ensure that color write mask works when blending is disabled.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 20, 2022
This PR adds a new test to ensure that color write mask works when blending is disabled.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 20, 2022
This PR implements 'blend_conmponent_clamp' test to ensure that
the blending components are clamped in the blend equation with simple
components.

Issue: gpuweb#1835
kainino0x added a commit that referenced this issue Nov 21, 2022
* op: Add 'color_write_mask,blending_disabled' to blending.spec.ts

This PR adds a new test to ensure that color write mask works when blending is disabled.

Issue: #1835

* nits: test names, description, and minor detail

Co-authored-by: Kai Ninomiya <[email protected]>
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 22, 2022
This PR implements the' blend_conmponents_clamp' test to ensure that the blending components
are clamped in the blend equation with the simple component values.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 22, 2022
…pec.ts

This PR adds a new test to ensure that write masks works alone or with multiple channels.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 22, 2022
…pec.ts

This PR adds a new test to ensure that write masks works alone or with multiple channels.

Issue: gpuweb#1835
Gyuyoung added a commit that referenced this issue Nov 22, 2022
…pec.ts (#2011)

This PR adds a new test to ensure that write masks works alone or with multiple channels.

Issue: #1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 22, 2022
This PR implements the' blend_conmponents_clamp' test to ensure that the blending components
are clamped in the blend equation with the simple component values.

Issue: gpuweb#1835
Gyuyoung added a commit that referenced this issue Nov 22, 2022
This PR implements the' blend_conmponents_clamp' test to ensure that the blending components
are clamped in the blend equation with the simple component values.

Issue: #1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 24, 2022
This PR adds the zero channel and all channels cases to the parameters.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Nov 29, 2022
This PR adds the zero channel and all channels cases to the parameters.

Issue: gpuweb#1835
kainino0x pushed a commit that referenced this issue Nov 30, 2022
This PR adds the zero channel and all channels cases to the parameters.

Issue: #1835
@Gyuyoung Gyuyoung moved this from Open (has TODO) to Started in CTS Dec 16, 2022
@Gyuyoung
Copy link
Collaborator

I think we need to do minor things for this issue further. But, It's likely we've done major ones for this issue. So I'm not sure if we can mark this issue as 'complete'.

@kainino0x
Copy link
Collaborator Author

Let's file a new issue with a more specific title, so we can see exactly what it's about, with a pointer to what needs to be done (hopefully there's a code comment for it). Then we can mark this complete.

@Gyuyoung
Copy link
Collaborator

It looks like we can add more tests referring to the ColorStateTest in Dawn end2end test [1]. If I find available tests there, let me file a new issue for them.

[1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/dawn/src/dawn/tests/end2end/ColorStateTests.cpp;l=29?q=ColorStateTests&ss=chromium

Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Jan 4, 2023
…amping' test

This PR adds srcFactor and dstFactor to the parameters of 'blending,clamping' test
in color_target_state.spec.ts.

Issue: gpuweb#1835
Gyuyoung added a commit to Gyuyoung/cts that referenced this issue Jan 5, 2023
…amping' test

This PR adds srcFactor and dstFactor to the parameters of 'blending,clamping' test
in color_target_state.spec.ts.

Issue: gpuweb#1835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Started
Development

No branches or pull requests

3 participants
@kainino0x @Gyuyoung and others