Skip to content

Commit

Permalink
Fix sync issues
Browse files Browse the repository at this point in the history
  • Loading branch information
davnotdev committed Apr 28, 2024
1 parent 399794e commit 65c03cb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/vulkan/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ impl VkContext {

// TODO FIX: Replace unwraps.
unsafe {
self.core
.dev
.wait_for_fences(&[frame_fence], true, std::u64::MAX)
.unwrap();
self.core.dev.reset_fences(&[frame_fence]).unwrap();

let (swapchain_image_index, _suboptimal) = if let Some(surface) = &*self.surface_ext {
match surface.swapchain.swapchain_ext.acquire_next_image(
surface.swapchain.swapchain,
Expand All @@ -113,12 +119,6 @@ impl VkContext {
(0, false)
};

self.core
.dev
.wait_for_fences(&[frame_fence], true, std::u64::MAX)
.unwrap();
self.core.dev.reset_fences(&[frame_fence]).unwrap();

self.core
.dev
.reset_command_buffer(
Expand Down

0 comments on commit 65c03cb

Please sign in to comment.