System: Fix crash toggling debug GPU device

When postfx is enabled.
This commit is contained in:
Stenzek 2024-03-24 20:46:58 +10:00
parent c0e6750ad3
commit 480c78502f
No known key found for this signature in database

View file

@ -900,7 +900,10 @@ bool System::RecreateGPU(GPURenderer renderer, bool force_recreate_device, bool
// create new renderer // create new renderer
g_gpu.reset(); g_gpu.reset();
if (force_recreate_device) if (force_recreate_device)
{
PostProcessing::Shutdown();
Host::ReleaseGPUDevice(); Host::ReleaseGPUDevice();
}
if (!CreateGPU(renderer, true)) if (!CreateGPU(renderer, true))
{ {
@ -2042,6 +2045,7 @@ bool System::CreateGPU(GPURenderer renderer, bool is_switching)
Log_ErrorPrintf("Failed to create fallback software renderer."); Log_ErrorPrintf("Failed to create fallback software renderer.");
if (!s_keep_gpu_device_on_shutdown) if (!s_keep_gpu_device_on_shutdown)
{ {
PostProcessing::Shutdown();
Host::ReleaseGPUDevice(); Host::ReleaseGPUDevice();
Host::ReleaseRenderWindow(); Host::ReleaseRenderWindow();
} }