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.
This commit is contained in:
Austin Shafer 2024-09-09 13:29:20 -04:00 committed by flightlessmango
parent 4b45e2612f
commit 2e7e86feef

View File

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