From cdb614a51fe8173132d1c80c4dbfc6384fbd331b Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 3 Feb 2024 16:00:24 +1000 Subject: [PATCH] GPU/HW: Fix possible crash (again) --- src/core/gpu_hw.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 24237930f..235d83240 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -413,10 +413,15 @@ void GPU_HW::UpdateSettings(const Settings& old_settings) { m_pgxp_depth_buffer = g_settings.UsingPGXPDepthBuffer(); m_batch.use_depth_buffer = false; - if (m_pgxp_depth_buffer) - ClearDepthBuffer(); - else if (m_vram_texture) // might be null when resizing - UpdateDepthBufferFromMaskBit(); + + // might be null when resizing + if (m_vram_texture) + { + if (m_pgxp_depth_buffer) + ClearDepthBuffer(); + else + UpdateDepthBufferFromMaskBit(); + } } UpdateSoftwareRenderer(true);