-
Notifications
You must be signed in to change notification settings - Fork 318
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
Does an override need to be statically used by the entry point to be allowed? #4624
Comments
This was identified thanks to an issue filed with Dawn here https://crbug.com/338624452 |
I like the way it is right now. I don't see the harm in being able to set overrides in the module that aren't used by the shader. The next rule correctly only requires overrides to be set if they have no default and are used by the entry point. |
My interpretation of the gpuweb/cts#1991 is that the title doesn't match the description very well. To me, the description says make sure to cover more indirect uses of overrides (e.g. via array element counts). |
GPU Web WG 2024-05-08 Pacific-time
|
WGSL 2024-05-14 Minutes
|
Summary: Yes, it's ok for pipeline creation to set the value of an override that is not statically used by the shader. From this part of the API spec:
In particular, the override declaration must exist in the shader but it does not have to be statically used by the entry point. Summarizing cases:
@jimblandy 's request is for a diagnostic , defaulted to 'off', which will trigger when setting an override that exists in the shader but is not used by the entry point. Related @dj2 filed gpuweb/cts#3747 to ensure CTS tests cases where an existing but unused override is either set or defaults to an invalid (e.g. overflowing) value. |
I've forked the diagnostic feature request into its own issue #4643 |
Since that's forked to its own M2 issue, I think this issue is back to M1 now. |
I think #4724 addressed this. |
The spec as written says that an override does not need to be statically used by an entry point, to be allowed to be specified in the pipeline descriptor:
This was only briefly discussed but it was an intentional choice: #1766 (comment)
However from gpuweb/cts#1991 and #3600 it seems like WGSL has been assuming that it does need to be statically used. I'm not sure if the two specs technically conflict since WebGPU does not use the "interface of a shader" in the validation rule, but they definitely sound like they conflict.
The text was updated successfully, but these errors were encountered: