Skip to content

Commit

Permalink
GS: Fix adc/skipping for packed regs
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Oct 3, 2023
1 parent 3293616 commit 012d31b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pcsx2/GS/GSState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,9 @@ void GSState::GIFPackedRegHandlerUV_Hack(const GIFPackedReg* RESTRICT r)
template <u32 prim, u32 adc, bool auto_flush, bool index_swap>
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]);
Expand All @@ -615,13 +617,15 @@ void GSState::GIFPackedRegHandlerXYZF2(const GIFPackedReg* RESTRICT r)

m_v.m[1] = xy.upl32(zf);

VertexKick<prim, auto_flush, index_swap>(adc ? 1 : r->XYZF2.Skip());
VertexKick<prim, auto_flush, index_swap>(skip);
}

template <u32 prim, u32 adc, bool auto_flush, bool index_swap>
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]);
Expand All @@ -630,7 +634,7 @@ void GSState::GIFPackedRegHandlerXYZ2(const GIFPackedReg* RESTRICT r)

m_v.m[1] = xyz.upl64(GSVector4i::loadl(&m_v.UV));

VertexKick<prim, auto_flush, index_swap>(adc ? 1 : r->XYZ2.Skip());
VertexKick<prim, auto_flush, index_swap>(skip);
}

void GSState::GIFPackedRegHandlerFOG(const GIFPackedReg* RESTRICT r)
Expand Down

0 comments on commit 012d31b

Please sign in to comment.