Skip to content

Commit

Permalink
Fix x11 hang when resizing on vulkan (#4184)
Browse files Browse the repository at this point in the history
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
  • Loading branch information
Azorlogh and cwfitzgerald authored Oct 3, 2023
1 parent e677b1e commit a4d733b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wgpu-hal/src/vulkan/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ impl super::Swapchain {
/// - The device must have been made idle before calling this function.
unsafe fn release_resources(self, device: &ash::Device) -> Self {
profiling::scope!("Swapchain::release_resources");
{
profiling::scope!("vkDeviceWaitIdle");
// We need to also wait until all presentation work is done. Because there is no way to portably wait until
// the presentation work is done, we are forced to wait until the device is idle.
let _ = unsafe { device.device_wait_idle() };
};
unsafe { device.destroy_fence(self.fence, None) };
self
}
Expand Down

0 comments on commit a4d733b

Please sign in to comment.