From f045a1742da7e8b3baa3a25494baa39496191a66 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 22 Jan 2025 18:23:14 +1000 Subject: [PATCH] GPUThread: Fix order of updating state Fixes unoverwritten textures not dumping on system shutdown. --- src/core/gpu_thread.cpp | 11 +++++------ src/core/system.cpp | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/core/gpu_thread.cpp b/src/core/gpu_thread.cpp index 07a36ad687..1c8ae3d676 100644 --- a/src/core/gpu_thread.cpp +++ b/src/core/gpu_thread.cpp @@ -805,12 +805,6 @@ bool GPUThread::CreateGPUBackendOnThread(GPURenderer renderer, bool upload_vram, void GPUThread::ReconfigureOnThread(GPUThreadReconfigureCommand* cmd) { - // Store state. - s_state.requested_vsync = cmd->vsync_mode; - s_state.requested_allow_present_throttle = cmd->allow_present_throttle; - s_state.requested_fullscreen_ui = cmd->start_fullscreen_ui.value_or(s_state.requested_fullscreen_ui); - s_state.game_serial = std::move(cmd->game_serial); - // Are we shutting down everything? if (!cmd->renderer.has_value() && !s_state.requested_fullscreen_ui) { @@ -820,6 +814,11 @@ void GPUThread::ReconfigureOnThread(GPUThreadReconfigureCommand* cmd) return; } + // Store state. + s_state.requested_vsync = cmd->vsync_mode; + s_state.requested_allow_present_throttle = cmd->allow_present_throttle; + s_state.requested_fullscreen_ui = cmd->start_fullscreen_ui.value_or(s_state.requested_fullscreen_ui); + s_state.game_serial = std::move(cmd->game_serial); g_gpu_settings = g_settings; // Readback old VRAM for hardware renderers. diff --git a/src/core/system.cpp b/src/core/system.cpp index bc75c8e9aa..ff6ced24cb 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -4185,9 +4185,6 @@ void System::UpdateRunningGame(const std::string& path, CDImage* image, bool boo } } - if (!booting) - GPUThread::SetGameSerial(s_state.running_game_serial); - if (!IsReplayingGPUDump()) { if (booting) @@ -4204,7 +4201,10 @@ void System::UpdateRunningGame(const std::string& path, CDImage* image, bool boo ApplySettings(true); if (s_state.running_game_serial != prev_serial) + { + GPUThread::SetGameSerial(s_state.running_game_serial); UpdateSessionTime(prev_serial); + } UpdateRichPresence(booting);