vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.45k stars 435 forks source link

Missing barriers when using "Feedback Loop" attachments #2538

Open Fuzzyzilla opened 2 months ago

Fuzzyzilla commented 2 months ago

Issue

When using feedback loop attachments (the same attachment referenced as both an input and a color attachment within a subpass), race conditions abound without any error from vulkano. Namely, two draw* commands with a pipeline that utilizes a feedback loop are not separated by a vkPipelineBarrier as they should be, confirmed using RenderDoc.

Note that this does not concern a single draw* touching the same sample multiple times, which is still a race condition under this configuration but falls under "general shader unsafety." Instead, multiple distinct draws within the same subpass should not display racing behavior, with barriers inserted between draw commands that write to the attachment and draw commands that read from it.

Results of running feedback_loop.rs on my system: (Expected behavior is a solid green triangle on blue background.) image