From dc129475bdebf4ae66f5def73855901640a8de07 Mon Sep 17 00:00:00 2001 From: Ivan 'provod' Avdeev Date: Mon, 30 May 2022 10:51:27 -0700 Subject: [PATCH] vk: fix synchronization on resize/swapchain recreation --- ref_vk/vk_swapchain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ref_vk/vk_swapchain.c b/ref_vk/vk_swapchain.c index 04ebd4b3..16444609 100644 --- a/ref_vk/vk_swapchain.c +++ b/ref_vk/vk_swapchain.c @@ -46,6 +46,8 @@ static void createDepthImage(int w, int h, VkFormat depth_format) { } static void destroySwapchainAndFramebuffers( VkSwapchainKHR swapchain ) { + XVK_CHECK(vkDeviceWaitIdle( vk_core.device )); + for (uint32_t i = 0; i < g_swapchain.num_images; ++i) { vkDestroyImageView(vk_core.device, g_swapchain.image_views[i], NULL); vkDestroyFramebuffer(vk_core.device, g_swapchain.framebuffers[i], NULL);