Skip to content

Commit

Permalink
vk: fix sync validation error on present()
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Mar 19, 2024
1 parent 2eb0db1 commit 0d2bb11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blade-graphics/src/vulkan/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(),
&[],
&[],
Expand Down

0 comments on commit 0d2bb11

Please sign in to comment.