mirror of https://github.com/PCSX2/pcsx2.git
GS/TextureCache: Only expand target on write on TBW match
This commit is contained in:
parent
06ef51db2e
commit
e76afee12d
|
@ -810,7 +810,12 @@ void GSTextureCache::ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVect
|
|||
}
|
||||
}
|
||||
|
||||
if (dst)
|
||||
if (!dst)
|
||||
return;
|
||||
|
||||
// Only expand the target when the FBW matches. Otherwise, games like GT4 will end up with the main render target
|
||||
// being 2000+ due to unrelated EE writes.
|
||||
if (TEX0.TBW == dst->m_TEX0.TBW)
|
||||
{
|
||||
// Round up to the nearest even height, like the draw target allocator.
|
||||
const s32 aligned_height = Common::AlignUpPow2(r.w, 2);
|
||||
|
@ -829,6 +834,14 @@ void GSTextureCache::ExpandTarget(const GIFRegBITBLTBUF& BITBLTBUF, const GSVect
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const GSVector4i clamped_r(
|
||||
r.rintersect(GSVector4i(0, 0, static_cast<int>(dst->m_texture->GetWidth() / dst->m_texture->GetScale().x),
|
||||
static_cast<int>(dst->m_texture->GetHeight() / dst->m_texture->GetScale().y))));
|
||||
AddDirtyRectTarget(dst, clamped_r, TEX0.PSM, TEX0.TBW);
|
||||
dst->UpdateValidity(clamped_r);
|
||||
}
|
||||
}
|
||||
// Goal: Depth And Target at the same address is not possible. On GS it is
|
||||
// the same memory but not on the Dx/GL. Therefore a write to the Depth/Target
|
||||
|
|
Loading…
Reference in New Issue