wgpu: DX12 Assertion failed left: -2005270523 with read only buffer
Description: I have a storage buffer that contains all the matrix data. Every object in my game has an offset for it’s data in this buffer.
My shader looks like this:
layout(set=2, binding=0). readonly buffer StorageBuffer{ mat4 transform;. };
(This is only a small snippet for the relevant part.)
I am creating the buffer like this:
let buffer = device.create_buffer(&BufferDescriptor { label: None, size: BIND_BUFFER_ALIGNMENT * 100, usage: BufferUsage::STORAGE | BufferUsage::COPY_DST, mapped_at_creation: false });
Here is the code bindgroup:
device.create_bind_group_layout(&BindGroupLayoutDescriptor { label: None, entries: &[BindGroupLayoutEntry { binding: 0, visibility: ShaderStage::VERTEX, ty: BindingType::Buffer { ty: BufferBindingType::Storage { read_only: true },has_dynamic_offset: true, min_binding_size: BufferSize::new(64) }, count: None }] })
In the render pass I am using it like this:
render_pass.set_bind_group(2,&camera.transform_bind_group,&[offset]);
If I change the storage buffer to a uniform buffer (in the shader too) everything is working.
The thing is this is all working perfectly fine on the VULKAN backend (with the storage buffer). I only wanted to test DX12 out and then I noticed this bug.
Extra materials:
panic:
thread 'main' panicked at 'assertion failed:
(left == right) left:
-2005270523, right:
0: error on command list creation: 887a0005'
Repro steps Use the DX12 backend. Use a SSBO in a shader.
Expected vs observed behavior panic vs no panic No panic on DX12 and VULKAN vs panic on DX12
Backtrace: pastebin: https://pastebin.com/2kRXLB1Z
Platform OS: Windows 10 GPU: NVIDIA GeForce GTX 1080 Ti Device-Type: DiscreteGpu wgpu-version: 0.8.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (13 by maintainers)
Yes I will
It is working with wgpu-version 0.9.0. The older version was the problem.
Here is the trace. trace.zip
Here is the log: https://gist.github.com/MrMarnic/1e40570bba35c805f0fbd576c74caa52