GPU/HW: Fix possible crash (again)

This commit is contained in:
Stenzek 2024-02-03 16:00:24 +10:00
parent cdea4eb68b
commit cdb614a51f
No known key found for this signature in database

View file

@ -413,11 +413,16 @@ void GPU_HW::UpdateSettings(const Settings& old_settings)
{ {
m_pgxp_depth_buffer = g_settings.UsingPGXPDepthBuffer(); m_pgxp_depth_buffer = g_settings.UsingPGXPDepthBuffer();
m_batch.use_depth_buffer = false; m_batch.use_depth_buffer = false;
// might be null when resizing
if (m_vram_texture)
{
if (m_pgxp_depth_buffer) if (m_pgxp_depth_buffer)
ClearDepthBuffer(); ClearDepthBuffer();
else if (m_vram_texture) // might be null when resizing else
UpdateDepthBufferFromMaskBit(); UpdateDepthBufferFromMaskBit();
} }
}
UpdateSoftwareRenderer(true); UpdateSoftwareRenderer(true);