Shader module unchecked doesn't disable bounds checking codegen #3483
Labels
api: metal
Issues with Metal
help required
We need community help to make this happen.
type: bug
Something isn't working
Description
Naga adds additional bounds checking code to WGSL shaders prior to compilation. It is configurable via Naga, but does not appear to work in
wgpu-rs
itself. In particular,create_shader_module_unchecked()
does not disable bounds checking. Note that I have only checked this on the Metal backend, as that is the hardware I am using/targeting.Repro steps
Create a WGSL shader that indexes into any array, buffer, matrix, or vec. Set
wgpu
to use the Metal backend. Run the executable through Xcode's shader debugger. You should see that, regardless of whether you usecreate_shader_module
orcreate_shader_module_unchecked
, the resulting Metal shader code contains various conditionals and bounds checking routines.Expected vs observed behavior
Ideally,
create_shader_module_unchecked
would disable bounds checking (or this would be configurable somehow via the API).Platform
MacOS Ventura 13.2,
wgpu
version 0.14.0, Metal backend.The text was updated successfully, but these errors were encountered: