From 28d2f395f45c7f78c5ce520d7ad7c790ef6e7241 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 1e3196a429295..2b5aa6d228dd5 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -7413,9 +7413,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;