From 279007544ab9f9f36a96a9d08426a0cc9e404cbf Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Fri, 11 Aug 2023 08:32:06 +0100 Subject: [PATCH] GS/HW: Allow double clear when src is lowest bitsize denominator --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 00fafc1808..4b672e7936 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -5593,7 +5593,7 @@ bool GSRendererHW::DetectDoubleHalfClear(bool& no_rt, bool& no_ds) const bool clear_depth = (m_cached_ctx.FRAME.FBP > m_cached_ctx.ZBUF.ZBP); const u32 base = clear_depth ? m_cached_ctx.ZBUF.ZBP : m_cached_ctx.FRAME.FBP; const u32 half = clear_depth ? m_cached_ctx.FRAME.FBP : m_cached_ctx.ZBUF.ZBP; - + const bool enough_bits = clear_depth ? (frame_psm.trbpp >= zbuf_psm.trbpp) : (zbuf_psm.trbpp >= frame_psm.trbpp); // Size of the current draw const u32 w_pages = (m_r.z + (frame_psm.pgs.x - 1)) / frame_psm.pgs.x; const u32 h_pages = (m_r.w + (frame_psm.pgs.y - 1)) / frame_psm.pgs.y; @@ -5607,7 +5607,7 @@ bool GSRendererHW::DetectDoubleHalfClear(bool& no_rt, bool& no_ds) // GTA: LCS does this setup, along with a few other games. Thankfully if it's a zero clear, we'll clear both // separately, and the end result is the same because it gets invalidated. That's better than falsely detecting // double half clears, and ending up with 1024 high render targets which really shouldn't be. - if ((frame_psm.fmt != zbuf_psm.fmt && m_cached_ctx.FRAME.FBMSK != ((zbuf_psm.fmt == 1) ? 0xFF000000u : 0)) || + if ((!enough_bits && frame_psm.fmt != zbuf_psm.fmt && m_cached_ctx.FRAME.FBMSK != ((zbuf_psm.fmt == 1) ? 0xFF000000u : 0)) || !GSUtil::HasCompatibleBits(m_cached_ctx.FRAME.PSM & ~0x30, m_cached_ctx.ZBUF.PSM & ~0x30)) // Bit depth is not the same (i.e. 32bit + 16bit). { GL_INS("Inconsistent FRAME [%s, %08x] and ZBUF [%s] formats, not using double-half clear.",