aclysma/rafx

crash when rendering wireframe with vulkan backend

aclysma opened this issue · 0 comments

The wireframe rendering codepath uses the same descriptor for set 0 as the depth shader. This was intended to work because they create the same descriptor set layout, and it works on the metal backend. However, vulkan fails, maybe because the deduplication is not working. This hashing/deduplication is supposed to happen in resource_lookup.rs, but that was designed before rafx_api and RafxRootSignature was a thing. We may need to move deduplication to happen in rafx_api.

(This became a crash in 2afe8fb but it was throwing validation errors before this)

The most straightforward but suboptimal fix is to create wireframe-specific descriptor sets and bind them. This means more descriptor sets, and prevents reusing them. Another approach would be to revisit how we handle descriptor set layouts and pipeline layouts to ensure that descriptor sets created for the depth shader are compatible with the wireframe shader. (This is broken in vulkan but metal works.)