video_core: Fixed incorrect Vulkan mode when speed unthrottled w/ vsync

When the frame limit was set to 0 (unthrottled), the Vulkan present mode would be unintentionally set to FIFO, which caps out at the monitor's refresh rate
This commit is contained in:
OpenSauce04 2025-05-15 13:21:57 +01:00 committed by OpenSauce
parent d878bfec3b
commit 8b939a9dab

View File

@ -183,9 +183,12 @@ void Swapchain::SetPresentMode() {
has_immediate ? vk::PresentModeKHR::eImmediate : vk::PresentModeKHR::eMailbox;
return;
}
const auto frame_limit = Settings::GetFrameLimit();
// If vsync is enabled attempt to use mailbox mode in case the user wants to speedup/slowdown
// the game. If mailbox is not available use immediate and warn about it.
if (use_vsync && Settings::GetFrameLimit() > 100) {
if (use_vsync && (frame_limit > 100 || frame_limit == 0)) { // 0 = unthrottled
present_mode = has_mailbox ? vk::PresentModeKHR::eMailbox : vk::PresentModeKHR::eImmediate;
if (!has_mailbox) {
LOG_WARNING(