aclysma / rafx

Multi-backend renderer with asset pipeline. The objective of this repo is to build a scalable, flexible, data driven renderer.
Apache License 2.0
640 stars 32 forks source link

crash when rendering wireframe with vulkan backend #174

Open aclysma opened 3 years ago

aclysma commented 3 years ago

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 2afe8fbd 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.)