From e6dbd55644d746e4fb0fbe9717bd64ee9a7f2c54 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 18 Oct 2022 22:35:39 +1000 Subject: [PATCH] Qt: Use vsync when any FSUI window is open Fixes high GPU usage when pause menu is opened. Previously, it was fine if you started from big picture mode, but not if you invoked it by opening the menu. --- pcsx2-qt/QtHost.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index e3a23874df..5fe6f00947 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -933,7 +933,9 @@ void Host::ReleaseHostDisplay() VsyncMode Host::GetEffectiveVSyncMode() { // Force vsync on when running big picture UI, and paused or no VM. - if (g_emu_thread->isRunningFullscreenUI()) + // We check the "running FSUI" flag here, because that way we set the initial vsync + // state when initalizing to on, avoiding an unnecessary switch. + if (FullscreenUI::HasActiveWindow() || (!FullscreenUI::IsInitialized() && g_emu_thread->isRunningFullscreenUI())) { const VMState state = VMManager::GetState(); if (state == VMState::Shutdown || state == VMState::Paused)