GS/HW: Allow moves to create larger targets, align to 64 width

This commit is contained in:
Stenzek 2023-02-15 21:48:11 +10:00 committed by refractionpcsx2
parent 8b4402c517
commit 4595c2feec
1 changed files with 3 additions and 2 deletions

View File

@ -1765,7 +1765,7 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
// Beware of the case where a game might create a larger texture by moving a bunch of chunks around.
// We use dx/dy == 0 and the TBW check as a safeguard to make sure these go through to local memory.
// Good test case for this is the Xenosaga I cutscene transitions, or Gradius V.
if (src && !dst && dx == 0 && dy == 0 && ((static_cast<u32>(w) + 63) / 64) == DBW)
if (src && !dst && dx == 0 && dy == 0 && ((static_cast<u32>(w) + 63) / 64) <= DBW)
{
GIFRegTEX0 new_TEX0 = {};
new_TEX0.TBP0 = DBP;
@ -1774,7 +1774,8 @@ bool GSTextureCache::Move(u32 SBP, u32 SBW, u32 SPSM, int sx, int sy, u32 DBP, u
const int real_height = GetTargetHeight(DBP, DBW, DPSM, h);
const GSVector2 scale(src->m_texture->GetScale());
dst = LookupTarget(new_TEX0, GSVector2i(static_cast<int>(w * scale.x), static_cast<int>(real_height * scale.y)), src->m_type, true);
dst = LookupTarget(new_TEX0, GSVector2i(static_cast<int>(Common::AlignUpPow2(w, 64) * scale.x),
static_cast<int>(real_height * scale.y)), src->m_type, true);
if (dst)
{
dst->m_texture->SetScale(scale);