Skip to content

Conversation

@dneto0
Copy link
Contributor

@dneto0 dneto0 commented Dec 17, 2020

Fixes: #1317

@dneto0 dneto0 added wgsl WebGPU Shading Language Issues for wgsl meeting labels Dec 17, 2020
@dneto0 dneto0 added this to the MVP milestone Dec 17, 2020
@dneto0 dneto0 requested a review from kvark December 17, 2020 22:38
`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 &sect; Sample Masking]].
Copy link
Contributor Author

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.

Copy link
Contributor

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.

@dneto0 dneto0 force-pushed the issue-1317-sample-mask branch from 853f62c to ef27603 Compare January 12, 2021 20:01
@github-actions
Copy link
Contributor

Previews, as seen at the time of posting this comment:
WebGPU | IDL
WGSL
ef27603

@dneto0
Copy link
Contributor Author

dneto0 commented Jan 12, 2021

Rebased onto main; resolved a conflict based on comment character (# to //)

@dj2 dj2 merged commit 7714248 into gpuweb:main Jan 12, 2021
dneto0 added a commit to dneto0/gpuweb that referenced this pull request Jan 12, 2021
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
dj2 pushed a commit that referenced this pull request Jan 12, 2021
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
ben-clayton pushed a commit to ben-clayton/gpuweb that referenced this pull request Sep 6, 2022
That's necessary for rgb10a2 like for the other copyToTexture tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wgsl WebGPU Shading Language Issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add sample_index and sample_mask builtin variables

4 participants