From 080c70e8a8908f0a6f6d7e72e908879a5def8c83 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Sat, 13 Aug 2022 13:59:17 +0100 Subject: [PATCH] GS: Add shortcut for Autoflush on Tri-Strip/Fan --- pcsx2/GS/GSState.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index aa3d333f43..c033ee67c3 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -2863,6 +2863,10 @@ GSState::PRIM_OVERLAP GSState::PrimitiveOverlap() __forceinline void GSState::HandleAutoFlush() { + // Kind of a cheat, making the assumption that 2 consecutive fan/strip triangles won't overlap each other (*should* be safe) + if ((m_index.tail & 1) && (PRIM->PRIM == GS_TRIANGLESTRIP || PRIM->PRIM == GS_TRIANGLEFAN)) + return; + const u32 frame_mask = GSLocalMemory::m_psm[m_context->TEX0.PSM].fmsk; const bool frame_hit = (m_context->FRAME.Block() == m_context->TEX0.TBP0) && !(m_context->TEST.ATE && m_context->TEST.ATST == 0 && m_context->TEST.AFAIL == 2) && ((m_context->FRAME.FBMSK & frame_mask) != frame_mask); // There's a strange behaviour we need to test on a PS2 here, if the FRAME is a Z format, like Powerdrome something swaps over, and it seems Alpha Fail of "FB Only" writes to the Z.. it's odd.