gfx-rs / wgpu

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

Add `strict_extension` option for SPIR-V frontend #6507

Open davnotdev opened 4 days ago

davnotdev commented 4 days ago

Is your feature request related to a problem? Please describe. I am trying to convert a SPIR-V shader that uses a dynamic sampler array to wgsl. However, the OpExtension "SPV_EXT_descriptor_indexing" instruction is not supported.

Describe the solution you'd like There could be a flag similar to strict_capabilities called strict_extensions which could throw a warning for unsupported extensions. Or there could be some other flag to only allow certain extensions.

Describe alternatives you've considered My currently solution is to remove the SPV_EXT_descriptor_indexing extension. Although this new shader does succeed when passed through naga, it does not pass spirv-val.

The disassembly of the shader in question

davnotdev commented 4 days ago

strict_extension would imply that by default, ALL extensions would pass whether they are supported or not. Perhaps something like allow_all_extensions would be less confusing?