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

Naga should not permit readable storage textures by default #4466

Closed
jimblandy opened this issue Feb 21, 2022 · 1 comment
Closed

Naga should not permit readable storage textures by default #4466

jimblandy opened this issue Feb 21, 2022 · 1 comment
Labels
area: validation Issues related to validation, diagnostics, and error handling naga Shader Translator

Comments

@jimblandy
Copy link
Member

As a deliberate extension for use by native apps, Naga accepts readable storage images, even though these are forbidden in the WGSL spec. However, Naga offers no means to disable this extension for WGSL compliance. This feature should be optional, and our tests should run with it disabled by default.

For example, the following declaration is accepted by Naga but rejected by Tint:

var image_storage_src: texture_storage_2d<rgba8uint, read>;

As explained in Matrix chat, Naga deliberately permits readable storage textures for use by native wgpu apps. However, when used in WebGPU, this should be disabled for consistency with other implementations.

I think Naga's tests should run with this disabled, so that we can assume that tests are spec-compliant WGSL unless explicitly marked otherwise.

Perhaps the best way to implement this would be to add a flag to naga::valid::Capabilities. I think this should be off by default.

@jimblandy jimblandy added the area: validation Issues related to validation, diagnostics, and error handling label Feb 21, 2022
@cwfitzgerald cwfitzgerald transferred this issue from gfx-rs/naga Oct 25, 2023
@cwfitzgerald cwfitzgerald added the naga Shader Translator label Oct 25, 2023
@teoxoy
Copy link
Member

teoxoy commented Nov 3, 2023

read-only storage textures have now landed in the core spec, we can close this.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Issues related to validation, diagnostics, and error handling naga Shader Translator
Projects
None yet
Development

No branches or pull requests

3 participants