Short info header:
I'm trying to build and run rawrscope. When I run it, it calls wgpu which calls gfx-rs in DX12 mode. When I run rawrscope (the application), during startup, it calls wgpu::Device::create_bind_group, causing gfx-backend-dx12 to panic from an assertion error.
Call stack (innermost last):
create_bind_groupwgpu_device_create_bind_groupdevice_create_bind_groupwrite_descriptor_sets fails an assertion with the following error: WARN@wgpu_core::instance Missing features: VERTEX_STORES_AND_ATOMICS | FRAGMENT_STORES_AND_ATOMICS
WARN@wgpu_core::instance max_bind_groups limit is missing
WARN@wgpu_core::device Surface does not support present mode: IMMEDIATE, falling back to FIFO
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `1`,
right: `0`', <::std::macros::panic macros>:5:6
stack backtrace:
...trimmed
13: std::panicking::begin_panic_fmt
at /rustc/4fb7144ed159f94491249e86d5bbd033b5d60550\/src\libstd\panicking.rs:332
14: gfx_backend_dx12::device::{{impl}}::write_descriptor_sets<alloc::vec::Vec<gfx_hal::pso::descriptor::DescriptorSetWrite<gfx_backend_dx12::Backend, core::iter::sources::Once<gfx_hal::pso::descriptor::Descriptor<gfx_backend_dx12::Backend>>>>,core::iter::sour
at <::std::macros::panic macros>:5
15: wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>::device_create_bind_group<wgpu_core::hub::IdentityManagerFactory,gfx_backend_dx12::Backend>
at C:\Users\nyanpasu\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-core-0.5.2\src\device\mod.rs:1206
16: wgpu::Device::create_bind_group
at C:\Users\nyanpasu\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.5.0\src\lib.rs:736
17: rawrscope::render::Renderer::new
at .\src\render.rs:104
I don't know what Git revision that gfx-rs v0.5.0 matches. I think it's one of the assertions in function https://github.com/gfx-rs/gfx/blob/fdfe887f5afab7ca057e3e824817d0bcdcf794ba/src/backend/dx12/src/device.rs#L2816
The panic message doesn't say which assertion is the issue.
Cloning gfx and overriding gfx-backend-dx12 locally broke because it referenced local gfx, whereas wgpu referenced Cargo gfx, and there were 2 copies of gfx traits. Instead I created a copy of local .cargo/.../gfx-backend-dx12 and labelled each assert_eq!() with a string. I found that the following line is failing:
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `1`,
right: `0`: SRV size % 4 != 0', <::std::macros::panic macros>:5:6
gfx-backend-dx12 references local filesystem gfx. Is this intentional?assert_eq! panic message/backtrace doesn't say which line caused the error, due to some symbol mishaps. It doesn't specify the expressions of the 2 arguments, only the values. Combined, these issues made it impossible to find which assertion failed, until I modified gfx-backend-dx12 locally.Hi 👋 thanks for reporting this bug!
When you push releases of gfx/etc. to crates.io, crates.io doesn't say which git tag was used, and the releases aren't tagged on Github.
We use branches per release, e.g. https://github.com/gfx-rs/gfx/tree/hal-0.5 matches 0.5 releases of gfx.
Git-cloned
gfx-backend-dx12references local filesystemgfx. Is this intentional?
Yeah this is intentional – the gfx repo is a workspace where crates reference each other locally (instead of referencing crates.io directly).
The
assert_eq!panic message/backtrace doesn't say which line caused the error, due to some symbol mishaps.
It may be a good idea to make the errors better by adding more metadata (like left/right expressions, or textual comments).
Agreed, it would be great to add messages to most (or all) asserts to make it clear what they're checking.
https://github.com/chiptunecafe/rawrscope/issues/14
The developer replied with the following message:
I think there's definitely value in keeping the issue open on the gfx repo just so that we can get better assert messages, but my issue here is that the docs are kinda unclear on what is and isn't allowed. In this case, I was _really_ lazily handling the scenario of the line storage buffer being empty by just creating a buffer with a single zero byte in it, but the DX12 backend seems to want the buffer lengths to be multiples of 4 bytes.
This crash was avoided in commit https://github.com/chiptunecafe/rawrscope/commit/e1969ca074129b46ca781a6a724aeb91ea3b37dc