-
Notifications
You must be signed in to change notification settings - Fork 353
WGSL: add sample_index, sample_mask_in, sample_mask_out #1318
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
Conversation
| `sample_mask` variable is [=statically accessed=] | ||
| by the fragment shader. If the variable is not statically accessed, | ||
| then other factors determine sample coverage. | ||
| <br>See [[WebGPU#sample-masking|WebGPU § Sample Masking]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an interesting case to think about: What is the initial value of sample_mask?
Our current rules have it default-initialized to 0. That is consistent but a foot-gun.
I thought about make a special rule to say it's initialized to all-1-bits, but then I didn't want to force backends to do an initial store, as that might mess up semantics somewhere along the way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should in general approach the topic of zero-initialization differently for built-in outputs. Sample mask is one example, but even just the output position is somewhat useless to initialize to all 0s.
853f62c to
ef27603
Compare
|
Rebased onto main; resolved a conflict based on comment character (# to //) |
That reflects the title of the previous PR gpuweb#1318, and the discussion in the meeting of 2021-01-12 So now there would be: sample_mask_in sample_mask_out
That reflects the title of the previous PR #1318, and the discussion in the meeting of 2021-01-12 So now there would be: sample_mask_in sample_mask_out
That's necessary for rgb10a2 like for the other copyToTexture tests.
Fixes: #1317