-
Notifications
You must be signed in to change notification settings - Fork 303
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
Do pipeline-creation errors encompass the whole module or just the GPUProgrammableStage? #4648
Comments
From the perspective of writing an external linker, I think it’s probably a little better to ignore errors in code unused by the stage. I don’t think it would matter much in my current implementation of wgsl-linker. But earlier versions left some unreferenced code in the linked result, and maybe some other tools will do that. So weak vote for being permissive about errors in unused code for the sake of future external wgsl code manglers. |
I'm not sure if this is the same issue but does this produce an error if I only reference
So it feels like the example with overrides would generate an error given the unused paths covered by #4568 also generate an error. |
Currently the only shader-creation error for workgroup_size is for a non-positive value. The upper limit is phrased as a pipeline-creation error. So it would be a similar question. |
We discussed this internally today. We think that pipeline-creation should be restricted to the stage being compiled generally. There are a few interesting cases that ought to lead to spec clarifications though. Consider the following:
For
It is possible the spec requires more clarification in override expressions to clarify the substitution of values happens before any expression evaluation and that it might cause some expressions to not be evaluated. |
WGSL 2024-06-04 Minutes
|
Related to #4624 and #4643.
Neither spec is clear on the content that is checked for pipeline-creation errors. Does it just encompass the code needed for the GPUProgrammableStage or the whole module? #4643 describes a diagnostic on something outside the code required for a GPUProgrammableStage so that might imply errors are from the whole module, but I don't remember either group ever making a conscious decision about this.
Example 1: module scope
When compiling
main
if we setunused
to a value> 1
should this produce an error?Example 2: used in different shader
When compiling
bar
is an error produced if the value ofx
is not set?For reference (but not to influence any decision), Dawn does not error in either case.
cc: @dneto0 @dj2 @kainino0x @jimblandy
The text was updated successfully, but these errors were encountered: