gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.16k stars 893 forks source link

Support the `readonly_and_readwrite_storage_textures` WGSL language extension #6204

Open ErichDonGubler opened 1 week ago

ErichDonGubler commented 1 week ago

Is your feature request related to a problem? Please describe.

The WGSL spec. defines a language extension called readonly_and_readwrite_storage_textures, which we can and should support.

Describe the solution you'd like

Implement this feature from the spec. It's not required for adherence to the spec., but there is interesting code in the wild (i.e., by ThreeJS) that already wants to use this language extension.

Describe alternatives you've considered

  1. Don't implement this. If we encounter an implementation blocker, or find other concerns with this feature, we might reasonably do this, but that's the only situation in which we'd be justified, I think.

Additional context

Related to #6192 in that it's expected that the requires directive is supported with the readonly_and_readwrite_storage_textures identifier specifically for this feature.

ErichDonGubler commented 1 week ago

Firefox tracking for this issue: bug 1916464

jimblandy commented 6 days ago

We actually already support this, we're just missing some validation.

teoxoy commented 2 days ago

There is one new built-in function that we are missing: textureBarrier(). Brought up by @mikialex in https://github.com/gfx-rs/wgpu/issues/6260.