From 00ef28a481f591cdd5e06783e737b1956ba1eeda Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sat, 4 May 2024 19:47:30 -0700 Subject: [PATCH] Fix racy depth buffer access by fog subpass --- client/src/graphics/base.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/graphics/base.rs b/client/src/graphics/base.rs index 339c504d..e3aa6fb2 100644 --- a/client/src/graphics/base.rs +++ b/client/src/graphics/base.rs @@ -215,10 +215,12 @@ impl Base { vk::SubpassDependency { src_subpass: 0, dst_subpass: 1, - src_stage_mask: vk::PipelineStageFlags::LATE_FRAGMENT_TESTS, // depth write - dst_stage_mask: vk::PipelineStageFlags::EARLY_FRAGMENT_TESTS, // depth read + src_stage_mask: vk::PipelineStageFlags::EARLY_FRAGMENT_TESTS + | vk::PipelineStageFlags::LATE_FRAGMENT_TESTS, // depth write + dst_stage_mask: vk::PipelineStageFlags::FRAGMENT_SHADER, // subpass input + src_access_mask: vk::AccessFlags::DEPTH_STENCIL_ATTACHMENT_WRITE, - dst_access_mask: vk::AccessFlags::DEPTH_STENCIL_ATTACHMENT_READ, + dst_access_mask: vk::AccessFlags::INPUT_ATTACHMENT_READ, dependency_flags: vk::DependencyFlags::BY_REGION, }, ]),