diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index f83cf2454..a385b7be3 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -80,9 +80,6 @@ GPU::~GPU() JoinScreenshotThreads(); DestroyDeinterlaceTextures(); g_gpu_device->RecycleTexture(std::move(m_chroma_smoothing_texture)); - - if (g_gpu_device) - g_gpu_device->SetGPUTimingEnabled(false); } bool GPU::Initialize() @@ -101,8 +98,6 @@ bool GPU::Initialize() return false; } - g_gpu_device->SetGPUTimingEnabled(g_settings.display_show_gpu_usage); - #ifdef PSX_GPU_STATS s_active_gpu_cycles = 0; s_active_gpu_cycles_frames = 0; @@ -147,8 +142,6 @@ void GPU::UpdateSettings(const Settings& old_settings) Panic("Failed to compile display pipeline on settings change."); } } - - g_gpu_device->SetGPUTimingEnabled(g_settings.display_show_gpu_usage); } void GPU::CPUClockChanged() diff --git a/src/core/system.cpp b/src/core/system.cpp index e48f6f248..c80a60891 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1911,6 +1911,9 @@ bool System::Initialize(bool force_software_renderer, Error* error) s_cpu_thread_handle = Threading::ThreadHandle::GetForCallingThread(); + if (g_settings.display_show_gpu_usage) + g_gpu_device->SetGPUTimingEnabled(true); + UpdateThrottlePeriod(); UpdateMemorySaveStateSettings(); return true; @@ -1971,6 +1974,7 @@ void System::DestroySystem() // Restore present-all-frames behavior. if (s_keep_gpu_device_on_shutdown && g_gpu_device) { + g_gpu_device->SetGPUTimingEnabled(false); UpdateDisplayVSync(); } else @@ -4447,6 +4451,9 @@ void System::CheckForSettingsChanges(const Settings& old_settings) UpdateSpeedLimiterState(); } + if (g_settings.display_show_gpu_usage != old_settings.display_show_gpu_usage) + g_gpu_device->SetGPUTimingEnabled(g_settings.display_show_gpu_usage); + if (g_settings.inhibit_screensaver != old_settings.inhibit_screensaver) { if (g_settings.inhibit_screensaver)