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
1 changed files with 4 additions and 0 deletions

View File

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