Skip to content
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 requires directive #6350

Open
ErichDonGubler opened this issue Oct 1, 2024 · 0 comments
Open

WGSL: Support the requires directive #6350

ErichDonGubler opened this issue Oct 1, 2024 · 0 comments
Labels
area: naga front-end lang: WGSL WebGPU Shading Language naga Shader Translator

Comments

@ErichDonGubler
Copy link
Member

Standard WGSL supports something called the requires global directive, which allows shaders to declare that certain extensions either need to be supported by the WebGPU host, or shader compilation should fail. It's used like this:

requires readonly_and_readwrite_storage_textures; // single extension
requires packed_4x8_integer_dot_product, unrestricted_pointer_parameters; // multiple extensions, comma-separated

WGSL standard link: https://www.w3.org/TR/WGSL/#requires-directive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end lang: WGSL WebGPU Shading Language naga Shader Translator
Projects
Status: Todo
Development

No branches or pull requests

1 participant