diff --git a/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/Vulkan.c.h b/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/Vulkan.c.h index 89ad9c1b5..e8318477d 100644 --- a/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/Vulkan.c.h +++ b/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/Vulkan.c.h @@ -1030,7 +1030,13 @@ void kinc_g5_end(int window) { present.pImageIndices = &vk_ctx.windows[vk_ctx.current_window].current_image; VkResult err = vk.fpQueuePresentKHR(vk_ctx.queue, &present); - assert(err == VK_SUCCESS || err == VK_ERROR_OUT_OF_DATE_KHR); + if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR) { + vkDeviceWaitIdle(vk_ctx.device); + create_swapchain(&vk_ctx.windows[window]); + } + else { + assert(err == VK_SUCCESS); + } reuse_descriptor_sets(); began = false;