From 6424e143830303c61a305b38fce1f7a6df467375 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sat, 4 May 2024 19:39:39 -0700 Subject: [PATCH] Fix depth buffer write-after-write hazard in subpass 0 --- client/src/graphics/base.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/graphics/base.rs b/client/src/graphics/base.rs index 95812081..339c504d 100644 --- a/client/src/graphics/base.rs +++ b/client/src/graphics/base.rs @@ -202,10 +202,14 @@ impl Base { vk::SubpassDependency { src_subpass: vk::SUBPASS_EXTERNAL, dst_subpass: 0, - src_stage_mask: vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT, - dst_stage_mask: vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT, + src_stage_mask: vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT + | vk::PipelineStageFlags::LATE_FRAGMENT_TESTS, + dst_stage_mask: vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT + | vk::PipelineStageFlags::EARLY_FRAGMENT_TESTS, dst_access_mask: vk::AccessFlags::COLOR_ATTACHMENT_READ - | vk::AccessFlags::COLOR_ATTACHMENT_WRITE, + | vk::AccessFlags::COLOR_ATTACHMENT_WRITE + | vk::AccessFlags::DEPTH_STENCIL_ATTACHMENT_READ + | vk::AccessFlags::DEPTH_STENCIL_ATTACHMENT_WRITE, ..Default::default() }, vk::SubpassDependency {