vk: fix synchronization on resize/swapchain recreation

This commit is contained in:
Ivan 'provod' Avdeev 2022-05-30 10:51:27 -07:00 committed by Ivan Avdeev
parent 2c667bdc60
commit dc129475bd

View File

@ -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);