From bd904b1367c7b5059e99310d560cc2b57cb31290 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sun, 12 Jan 2025 08:26:38 +0000 Subject: [PATCH] GS/HW: Fix misdetection of draw as clear with fog effect --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 97a33a0e0f3ad..bb46dd0a2f6a7 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -7412,9 +7412,10 @@ ClearType GSRendererHW::IsConstantDirectWriteMemClear() && !(m_draw_env->SCANMSK.MSK & 2) && !m_cached_ctx.TEST.ATE // no alpha test && !m_cached_ctx.TEST.DATE // no destination alpha test && (!m_cached_ctx.TEST.ZTE || m_cached_ctx.TEST.ZTST == ZTST_ALWAYS) // no depth test - && (m_vt.m_eq.rgba == 0xFFFF || m_vertex.next == 2)) // constant color write + && (m_vt.m_eq.rgba == 0xFFFF || m_vertex.next == 2) // constant color write + && (!PRIM->FGE || m_vt.m_min.p.w == 255.0f)) // No fog effect { - if (PRIM->ABE && (!m_context->ALPHA.IsOpaque() || m_cached_ctx.FRAME.FBMSK)) + if ((PRIM->ABE && !m_context->ALPHA.IsOpaque()) || (m_cached_ctx.FRAME.FBMSK & GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].fmsk)) return ClearWithDraw; return NormalClear;