Fix rewind selector UI freezing issue

pull/3590/head
mariobob 7 days ago
parent e99963d5e0
commit d1e63624e1

@ -1478,7 +1478,8 @@ void GPUThread::UpdateRunIdle()
static_cast<u8>(RunIdleReason::SystemPaused) |
static_cast<u8>(RunIdleReason::LoadingScreenActive);
static constexpr u8 ACTIVATE_MASK =
static_cast<u8>(RunIdleReason::FullscreenUIActive) | static_cast<u8>(RunIdleReason::LoadingScreenActive);
static_cast<u8>(RunIdleReason::FullscreenUIActive) | static_cast<u8>(RunIdleReason::LoadingScreenActive) |
static_cast<u8>(RunIdleReason::RewindSelectorActive);
const bool new_flag = (g_gpu_device && ((s_state.run_idle_reasons & REQUIRE_MASK) != 0) &&
((s_state.run_idle_reasons & ACTIVATE_MASK) != 0));

@ -37,6 +37,7 @@ enum class RunIdleReason : u8
SystemPaused = (1 << 1),
FullscreenUIActive = (1 << 2),
LoadingScreenActive = (1 << 3),
RewindSelectorActive = (1 << 4),
};
/// Starts Big Picture UI.

@ -5301,6 +5301,9 @@ void System::OpenRewindStateSelector()
s_state.rewind_selector_states = GetAvailableRewindStates();
s_state.rewind_selector_index = 0;
// Set the run idle reason so the GPU thread keeps processing events
GPUThread::SetRunIdleReason(GPUThread::RunIdleReason::RewindSelectorActive, true);
// Pause the game
s_state.was_paused_before_rewind_selector = GPUThread::IsSystemPaused();
if (!s_state.was_paused_before_rewind_selector)
@ -5319,6 +5322,9 @@ void System::CloseRewindStateSelector()
// Unpause if it wasn't paused before
if (GPUThread::IsSystemPaused() && !s_state.was_paused_before_rewind_selector)
Host::RunOnCPUThread([]() { System::PauseSystem(false); });
// Clear the run idle reason
GPUThread::SetRunIdleReason(GPUThread::RunIdleReason::RewindSelectorActive, false);
}
bool System::IsRewindStateSelectorOpen()

Loading…
Cancel
Save