From c9d2bc91aace984b0c5fc1fcfa5b68e0a33e2ef6 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Tue, 7 Feb 2023 13:43:14 -0800 Subject: [PATCH] Recreate swap chain when suboptimal to avoid error spam --- drivers/vulkan/vulkan_context.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 864ad5931a1..58855c261d8 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -2268,8 +2268,8 @@ Error VulkanContext::prepare_buffers() { } else if (err == VK_SUBOPTIMAL_KHR) { // Swapchain is not as optimal as it could be, but the platform's // presentation engine will still present the image correctly. - print_verbose("Vulkan: Early suboptimal swapchain."); - break; + print_verbose("Vulkan: Early suboptimal swapchain, recreating."); + _update_swap_chain(w); } else if (err != VK_SUCCESS) { ERR_BREAK_MSG(err != VK_SUCCESS, "Vulkan: Did not create swapchain successfully."); } else {