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

Adjust fragment state blend factor and write mask validation #3217

Merged

Conversation

shrekshao
Copy link
Contributor

@shrekshao shrekshao commented Dec 7, 2023

Issue: https://crbug.com/dawn/2272

Validation in chrome impl needs adjustment: https://dawn-review.googlesource.com/c/dawn/+/164922


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 December 7, 2023 23:14
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

@kainino0x kainino0x merged commit 114229d into gpuweb:main Dec 8, 2023
1 check passed
@@ -422,6 +432,6 @@ g.test('pipeline_output_targets,blend')
const _success =
info.color.type === sampleType &&
componentCount >= kTexelRepresentationInfo[format].componentOrder.length &&
meetsExtraBlendingRequirement;
(meetsExtraBlendingRequirement || writeMask === 0);
Copy link
Collaborator

@kainino0x kainino0x Dec 8, 2023

Choose a reason for hiding this comment

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

Sorry, I just reread the spec and I think I misinterpreted this the other day.
IIUC actually the only case where writeMask=0 makes it valid is when the fragment shader has no output to that location. If it has output to that location, then the writeMask isn't checked by the validation in the spec.
https://gpuweb.github.io/gpuweb/#abstract-opdef-validating-gpufragmentstate

I do believe we could loosen the validation in the way that you've done here, but it would require a spec change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you are right. The "Otherwise..." is at the same level as

"If get the entry point(FRAGMENT, descriptor) has a shader stage output value output with location attribute equal to index:"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I do believe we could loosen the validation in the way that you've done here, but it would require a spec change.

For reference the spec issue was gpuweb/gpuweb#2013

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