From 0d2bb110a6ac8f61011482158f093239fa7a2a46 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 18 Mar 2024 17:29:55 -0700 Subject: [PATCH] vk: fix sync validation error on present() --- blade-graphics/src/vulkan/command.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blade-graphics/src/vulkan/command.rs b/blade-graphics/src/vulkan/command.rs index cc903fbf..15010a8b 100644 --- a/blade-graphics/src/vulkan/command.rs +++ b/blade-graphics/src/vulkan/command.rs @@ -297,6 +297,7 @@ impl super::CommandEncoder { pub fn present(&mut self, frame: super::Frame) { assert_eq!(self.present, None); + let wa = &self.device.workarounds; self.present = Some(super::Presentation { image_index: frame.image_index, acquire_semaphore: frame.acquire_semaphore, @@ -313,12 +314,13 @@ impl super::CommandEncoder { base_array_layer: 0, layer_count: 1, }) + .src_access_mask(vk::AccessFlags::MEMORY_WRITE | wa.extra_sync_src_access) .build(); unsafe { self.device.core.cmd_pipeline_barrier( self.buffers[0].raw, - vk::PipelineStageFlags::TOP_OF_PIPE, vk::PipelineStageFlags::ALL_COMMANDS, + vk::PipelineStageFlags::BOTTOM_OF_PIPE, vk::DependencyFlags::empty(), &[], &[],