From af2042e713e5927963e4dbfb023fb8cd242402d1 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 31 Jan 2024 00:16:21 +1000 Subject: [PATCH] GPU/HW: Fix toggling PGXP depth buffer causing black screen --- src/core/gpu_hw.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 193812bf7..88a7704c8 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -221,6 +221,7 @@ bool GPU_HW::Initialize() m_downsample_mode = GetDownsampleMode(m_resolution_scale); m_wireframe_mode = g_settings.gpu_wireframe_mode; m_disable_color_perspective = features.noperspective_interpolation && ShouldDisableColorPerspective(); + m_pgxp_depth_buffer = g_settings.UsingPGXPDepthBuffer(); CheckSettings(); @@ -414,6 +415,8 @@ void GPU_HW::UpdateSettings(const Settings& old_settings) m_batch.use_depth_buffer = false; if (m_pgxp_depth_buffer) ClearDepthBuffer(); + else + UpdateDepthBufferFromMaskBit(); } UpdateSoftwareRenderer(true); @@ -504,8 +507,6 @@ void GPU_HW::CheckSettings() if (box_downscale == g_settings.gpu_resolution_scale) m_downsample_mode = GPUDownsampleMode::Disabled; } - - m_pgxp_depth_buffer = g_settings.UsingPGXPDepthBuffer(); } u32 GPU_HW::CalculateResolutionScale() const