-
Notifications
You must be signed in to change notification settings - Fork 984
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
WGSL: Support the enable
directive
#5476
Labels
area: correctness
We're behaving incorrectly
area: cts
Issues stemming from the WebGPU Conformance Test Suite
area: naga front-end
lang: WGSL
WebGPU Shading Language
naga
Shader Translator
Comments
Part of #4384. |
armansito
added a commit
to linebender/vello
that referenced
this issue
Apr 19, 2024
The WGSL source currently cannot contain the "enable" directive as naga doesn't support it (see gfx-rs/wgpu#5476). This patch works around this limitation by introducing the "#enable" post-process directive. Lines that start with "#enable" get turned into an inline comment during the pre-process stage and converted to a standard "enable" directive following the intermediate module compilation step. This allows us to pass the WGSL shaders with enable directives on to other WebGPU implementations.
github-merge-queue bot
pushed a commit
to linebender/vello
that referenced
this issue
Apr 19, 2024
* [shaders] Support "enable" via post-process directive The WGSL source currently cannot contain the "enable" directive as naga doesn't support it (see gfx-rs/wgpu#5476). This patch works around this limitation by introducing the "#enable" post-process directive. Lines that start with "#enable" get turned into an inline comment during the pre-process stage and converted to a standard "enable" directive following the intermediate module compilation step. This allows us to pass the WGSL shaders with enable directives on to other WebGPU implementations. * Document that r8unorm is available in Dawn native and not web
github-merge-queue bot
pushed a commit
to linebender/vello
that referenced
this issue
Apr 19, 2024
* [shaders] Support "enable" via post-process directive The WGSL source currently cannot contain the "enable" directive as naga doesn't support it (see gfx-rs/wgpu#5476). This patch works around this limitation by introducing the "#enable" post-process directive. Lines that start with "#enable" get turned into an inline comment during the pre-process stage and converted to a standard "enable" directive following the intermediate module compilation step. This allows us to pass the WGSL shaders with enable directives on to other WebGPU implementations. * Document that r8unorm is available in Dawn native and not web
This comment was marked as resolved.
This comment was marked as resolved.
3 tasks
enable
directiveenable
directive
6 tasks
7 tasks
This comment was marked as resolved.
This comment was marked as resolved.
Resolved by #6424. 👏🏻 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: correctness
We're behaving incorrectly
area: cts
Issues stemming from the WebGPU Conformance Test Suite
area: naga front-end
lang: WGSL
WebGPU Shading Language
naga
Shader Translator
The WGSL specification has introduced the
enable
directive for to implementation-specific extensions (see https://www.w3.org/TR/WGSL/#enable-extensions-sec). Currently naga rejects these as an invalid token, for example:Even if naga doesn't support a requested extension, it should recognize the
enable
directive. In my specific use case, naga is used to parse and preprocess WGSL which may end up getting passed on to a different implementation (i.e. Dawn/Chromium). It would be nice to be able to declare Chromium-specific enable directives for the wgsl-in -> wgsl-out case.The text was updated successfully, but these errors were encountered: