From 012d31b4d793f652dab24322bb62c924104cd4f8 Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Tue, 3 Oct 2023 15:03:46 +0100 Subject: [PATCH] GS: Fix adc/skipping for packed regs --- pcsx2/GS/GSState.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pcsx2/GS/GSState.cpp b/pcsx2/GS/GSState.cpp index 93118b39311a2c..2c6f85f3d22d5a 100644 --- a/pcsx2/GS/GSState.cpp +++ b/pcsx2/GS/GSState.cpp @@ -604,7 +604,9 @@ void GSState::GIFPackedRegHandlerUV_Hack(const GIFPackedReg* RESTRICT r) template void GSState::GIFPackedRegHandlerXYZF2(const GIFPackedReg* RESTRICT r) { - if (!adc || GSUtil::GetPrimClass(m_prev_env.PRIM.PRIM) != GSUtil::GetPrimClass(m_env.PRIM.PRIM) || (m_dirty_gs_regs & (1 << DIRTY_REG_XYOFFSET))) + const bool skip = adc || r->XYZF2.Skip(); + + if (!skip || GSUtil::GetPrimClass(m_prev_env.PRIM.PRIM) != GSUtil::GetPrimClass(m_env.PRIM.PRIM) || (m_dirty_gs_regs & (1 << DIRTY_REG_XYOFFSET))) CheckFlushes(); GSVector4i xy = GSVector4i::loadl(&r->U64[0]); @@ -615,13 +617,15 @@ void GSState::GIFPackedRegHandlerXYZF2(const GIFPackedReg* RESTRICT r) m_v.m[1] = xy.upl32(zf); - VertexKick(adc ? 1 : r->XYZF2.Skip()); + VertexKick(skip); } template void GSState::GIFPackedRegHandlerXYZ2(const GIFPackedReg* RESTRICT r) { - if (!adc || GSUtil::GetPrimClass(m_prev_env.PRIM.PRIM) != GSUtil::GetPrimClass(m_env.PRIM.PRIM) || (m_dirty_gs_regs & (1 << DIRTY_REG_XYOFFSET))) + const bool skip = adc || r->XYZ2.Skip(); + + if (!skip || GSUtil::GetPrimClass(m_prev_env.PRIM.PRIM) != GSUtil::GetPrimClass(m_env.PRIM.PRIM) || (m_dirty_gs_regs & (1 << DIRTY_REG_XYOFFSET))) CheckFlushes(); const GSVector4i xy = GSVector4i::loadl(&r->U64[0]); @@ -630,7 +634,7 @@ void GSState::GIFPackedRegHandlerXYZ2(const GIFPackedReg* RESTRICT r) m_v.m[1] = xyz.upl64(GSVector4i::loadl(&m_v.UV)); - VertexKick(adc ? 1 : r->XYZ2.Skip()); + VertexKick(skip); } void GSState::GIFPackedRegHandlerFOG(const GIFPackedReg* RESTRICT r)