Skip to content

Sampler buffer of group SamplerIndexBufferKey { group: 0 } not bound to a register for unused and unbound sampler buffer on DX12 #7638

@ErichDonGubler

Description

@ErichDonGubler

When I run the trace contained in wgpu-trace-crashy-on-doze.zip against WGPU on the DX12 backend on Windows, recorded from running https://webgpu.github.io/webgpu-samples/?sample=bitonicSort in Firefox:

RUST_BACKTRACE=1 cargo run -p player -- ~/Downloads/wgpu-trace-crashy-on-doze/0/
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.00s
     Running `target\debug\play.exe C:\Users\Erich\Downloads/wgpu-trace-crashy-on-doze/0\`
thread 'main' panicked at E:\wgpu\naga\src\back\hlsl\help.rs:1690:17:
internal error: entered unreachable code: Sampler buffer of group SamplerIndexBufferKey { group: 0 } not bound to a register
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/core\src\panicking.rs:76
   2: naga::back::hlsl::Writer<ref_mut$<alloc::string::String> >::write_wrapped_sampler_buffer<ref_mut$<alloc::string::String> >
             at .\naga\src\back\hlsl\help.rs:1690
   3: naga::back::hlsl::Writer<ref_mut$<alloc::string::String> >::write_global_sampler<ref_mut$<alloc::string::String> >
             at .\naga\src\back\hlsl\writer.rs:1060
   4: naga::back::hlsl::Writer<ref_mut$<alloc::string::String> >::write_global<ref_mut$<alloc::string::String> >
             at .\naga\src\back\hlsl\writer.rs:901
   5: naga::back::hlsl::Writer<ref_mut$<alloc::string::String> >::write<ref_mut$<alloc::string::String> >
             at .\naga\src\back\hlsl\writer.rs:382
   6: wgpu_hal::dx12::Device::load_shader
             at .\wgpu-hal\src\dx12\device.rs:307
   7: wgpu_hal::dx12::device::impl$1::create_render_pipeline
             at .\wgpu-hal\src\dx12\device.rs:1669
   8: wgpu_hal::dynamic::device::impl$0::create_render_pipeline<wgpu_hal::dx12::Device>
             at .\wgpu-hal\src\dynamic\device.rs:402
   9: wgpu_core::device::resource::Device::create_render_pipeline
             at .\wgpu-core\src\device\resource.rs:3632
  10: wgpu_core::global::Global::device_create_render_pipeline
             at .\wgpu-core\src\device\global.rs:1319
  11: player::impl$0::process
             at .\player\src\lib.rs:375
  12: play::main
             at .\player\src\bin\play.rs:105
  <snip>

This does not happen on macOS for me (N.B., adjusting backend: Dx12 in trace.ron), so this seems like a backend-specific problem.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions