GS: Fixes for flushes from PR #6389

This commit is contained in:
refractionpcsx2 2022-10-07 23:27:09 +01:00
parent 1910c8fc0f
commit 9750cfe6bf
1 changed files with 9 additions and 7 deletions

View File

@ -802,7 +802,7 @@ void GSState::GIFPackedRegHandlerXYZF2(const GIFPackedReg* RESTRICT r)
m_v.m[1] = xy.upl32(zf);
VertexKick<prim, auto_flush, index_swap>(adc ? 1 : r->XYZ2.Skip());
VertexKick<prim, auto_flush, index_swap>(adc ? 1 : r->XYZF2.Skip());
}
template <u32 prim, u32 adc, bool auto_flush, bool index_swap>
@ -1945,17 +1945,19 @@ void GSState::Write(const u8* mem, int len)
if (!m_tr.Update(w, h, psm.trbpp, len))
return;
// TODO: Not really sufficient if a partial texture update is done outside the block.
// No need to check CLUT here, we can invalidate it below, no need to flush it since TEX0 needs to update, then we can flush.
// Only flush on a NEW transfer if a pending one is using the same address.
// Check Fast & Furious (Hardare mode) and Assault Suits Valken (either renderer).
if (m_tr.end == 0 && m_index.tail > 0 && m_prev_env.PRIM.TME &&
(blit.DBP == m_prev_env.CTXT[m_prev_env.PRIM.CTXT].TEX0.TBP0 || blit.DBP == m_prev_env.CTXT[m_prev_env.PRIM.CTXT].TEX0.CBP))
Flush();
GL_CACHE("Write! ... => 0x%x W:%d F:%s (DIR %d%d), dPos(%d %d) size(%d %d)",
blit.DBP, blit.DBW, psm_str(blit.DPSM),
m_env.TRXPOS.DIRX, m_env.TRXPOS.DIRY,
m_env.TRXPOS.DSAX, m_env.TRXPOS.DSAY, w, h);
// TODO: Not really sufficient if a partial texture update is done outside the block.
// No need to check CLUT here, we can invalidate it below, no need to flush it since TEX0 needs to update, then we can flush.
if ((PRIM->TME && (blit.DBP == m_context->TEX0.TBP0)) ||
(m_prev_env.PRIM.TME && (blit.DBP == m_prev_env.CTXT[m_prev_env.PRIM.CTXT].TEX0.TBP0)))
Flush();
if (m_tr.end == 0 && len >= m_tr.total)
{
// received all data in one piece, no need to buffer it