video_core: Fixed incorrect Vulkan mode when speed unthrottled w/ vsync
Some checks failed
citra-build / source (push) Has been cancelled
citra-build / linux (appimage) (push) Has been cancelled
citra-build / linux (fresh) (push) Has been cancelled
citra-build / macos (arm64) (push) Has been cancelled
citra-build / macos (x86_64) (push) Has been cancelled
citra-build / windows (msvc) (push) Has been cancelled
citra-build / windows (msys2) (push) Has been cancelled
citra-build / android (push) Has been cancelled
citra-build / ios (push) Has been cancelled
citra-format / clang-format (push) Has been cancelled
citra-transifex / transifex (push) Has been cancelled
citra-build / macos-universal (push) Has been cancelled

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(