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,render_pipeline,alpha_to_coverage #2202

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

shrekshao
Copy link
Contributor

@shrekshao shrekshao commented Jan 25, 2023

Issue: #2201

Add the alphaToCoverage mask tests.

Remove the src/webgpu/api/operation/render_pipeline/alpha_to_coverage.spec.ts stub and put tests under src/webgpu/api/operation/render_pipeline/sample_mask.spec.ts to share code.

The algorithm of producing the alpha-to-coverage mask is platform-dependent. And the requirement of alphaToCoverage mask of alpha where 0 < alpha < 1 is only that the mask bits should be non-decreasing.
So instead of putting alpha = { < 0, = 0, = 1/16, = 2/16, ..., = 15/16, = 1, > 1 } in params subcases, put them inside the test. Draw and readback the value for each alpha value. Iterate through them and compare the result value with that of the previous alpha value (alpha'). Check if the result is non-decreasing for each component (for color, stencil), or non-increasing if the value is in negative-correlation to the alpha mask (depth)


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

When landing this PR, be sure to make any necessary issue status updates.

@shrekshao shrekshao requested a review from kainino0x January 25, 2023 23:04
@github-actions
Copy link

Previews, as seen when this build job started (525ab73):
Run tests | View tsdoc

Copy link
Collaborator

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with minor comments

@shrekshao shrekshao force-pushed the alpha-to-coverage-mask branch from edd3170 to 47942f3 Compare January 31, 2023 18:23
@github-actions
Copy link

Previews, as seen when this build job started (4c4842c):
Run tests | View tsdoc

@shrekshao shrekshao merged commit b625799 into gpuweb:main Jan 31, 2023
ErichDonGubler pushed a commit to mozilla/gpuweb-cts that referenced this pull request Aug 16, 2023
* op,render_pipeline,alpha_to_coverage

* fix async
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants