From 2e7e86feefc313be76881190949eb609b05c725a Mon Sep 17 00:00:00 2001 From: Austin Shafer Date: Mon, 9 Sep 2024 13:29:20 -0400 Subject: [PATCH] vulkan: Fix present mode fallback override In overlay_CreateSwapchainKHR, if IsPresentModeSupported returns false (which it will when FIFO_RELAXED is not supported) it sets HUDElements.cur_present_mode to VK_PRESENT_MODE_FIFO_KHR but it does not update createInfo.presentMode. This can cause swapchain creation to fail since it's trying to use an unsupported present mode. This updates the createInfo's presentMode as well to prevent this. --- src/vulkan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vulkan.cpp b/src/vulkan.cpp index 4dcc600..2db5310 100644 --- a/src/vulkan.cpp +++ b/src/vulkan.cpp @@ -1547,6 +1547,7 @@ static VkResult overlay_CreateSwapchainKHR( else { SPDLOG_DEBUG("Present mode is not supported: {}", HUDElements.presentModeMap[HUDElements.cur_present_mode]); HUDElements.cur_present_mode = VK_PRESENT_MODE_FIFO_KHR; + createInfo.presentMode = VK_PRESENT_MODE_FIFO_KHR; } } }