System: Ensure GPU is flushed before invalidating on pause

This commit is contained in:
Stenzek 2024-02-27 20:44:15 +10:00
parent a63e78d83c
commit eb7b6d217d
No known key found for this signature in database
1 changed files with 9 additions and 3 deletions

View File

@ -1110,6 +1110,9 @@ void System::PauseSystem(bool paused)
if (paused) if (paused)
{ {
// Make sure the GPU is flushed, otherwise the VB might still be mapped.
g_gpu->FlushRender();
FullscreenUI::OnSystemPaused(); FullscreenUI::OnSystemPaused();
InputManager::PauseVibration(); InputManager::PauseVibration();
@ -1187,7 +1190,10 @@ bool System::LoadState(const char* filename)
ResetPerformanceCounters(); ResetPerformanceCounters();
ResetThrottler(); ResetThrottler();
InvalidateDisplay();
if (IsPaused())
InvalidateDisplay();
Log_VerbosePrintf("Loading state took %.2f msec", load_timer.GetTimeMilliseconds()); Log_VerbosePrintf("Loading state took %.2f msec", load_timer.GetTimeMilliseconds());
return true; return true;
} }
@ -1974,7 +1980,6 @@ void System::RecreateSystem()
ResetPerformanceCounters(); ResetPerformanceCounters();
ResetThrottler(); ResetThrottler();
InvalidateDisplay();
if (was_paused) if (was_paused)
PauseSystem(true); PauseSystem(true);
@ -3662,7 +3667,8 @@ void System::CheckForSettingsChanges(const Settings& old_settings)
g_settings.runahead_frames != old_settings.runahead_frames) g_settings.runahead_frames != old_settings.runahead_frames)
{ {
g_gpu->UpdateSettings(old_settings); g_gpu->UpdateSettings(old_settings);
InvalidateDisplay(); if (!IsPaused())
InvalidateDisplay();
} }
if (g_settings.gpu_widescreen_hack != old_settings.gpu_widescreen_hack || if (g_settings.gpu_widescreen_hack != old_settings.gpu_widescreen_hack ||