From 9ec41436d16c8d11d1bc4e9dd15482dffe7faa74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 1 Oct 2022 19:06:02 +0200 Subject: [PATCH] ES2 crash fix: Don't draw depth if lacking fragment shader depth write. --- GPU/Common/FramebufferManagerCommon.cpp | 2 +- GPU/Common/TextureCacheCommon.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index f97f2e91c0..a9487dd6f7 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -575,7 +575,7 @@ void FramebufferManagerCommon::SetDepthFrameBuffer(bool isClearingDepth) { // Need to upload the first line of depth buffers, for Burnout Dominator lens flares. See issue #11100 and comments to #16081. // Might make this more generic and upload the whole depth buffer if we find it's needed for something. - if (newlyUsingDepth) { + if (newlyUsingDepth && draw_->GetDeviceCaps().fragmentShaderDepthWriteSupported) { // Sanity check the depth buffer pointer. if (Memory::IsValidRange(currentRenderVfb_->z_address, currentRenderVfb_->width * 2)) { const u16 *src = (const u16 *)Memory::GetPointerUnchecked(currentRenderVfb_->z_address); diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 1b7d8d5986..d55f890f64 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -1252,6 +1252,7 @@ void TextureCacheCommon::LoadClut(u32 clutAddr, u32 loadBytes) { } } + // To turn off dynamic CLUT (for demonstration or testing purposes), add "false &&" to this check. if (chosenFramebuffer && chosenFramebuffer->fbo) { clutRenderAddress_ = bestClutAddress;