mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
GS/TC: Only adjust target start on full pages
This commit is contained in:
committed by
lightningterror
parent
8a7cb62b01
commit
c0f1e713d3
@@ -3877,9 +3877,13 @@ bool GSTextureCache::PreloadTarget(GIFRegTEX0 TEX0, const GSVector2i& size, cons
|
||||
}
|
||||
|
||||
const int height_adjust = ((((dst_end_block + 31) - old_dst->m_TEX0.TBP0) >> 5) / std::max(old_dst->m_TEX0.TBW, 1U)) * GSLocalMemory::m_psm[old_dst->m_TEX0.PSM].pgs.y;
|
||||
bool delete_target = true;
|
||||
|
||||
if (height_adjust < old_dst->m_unscaled_size.y)
|
||||
// If it's only a partial overlap, we don't want to change the TBP, it needs to be on a page boundary, we can just lump it.
|
||||
const GSVector4i dst_valid_rounded = GSVector4i(dst_valid.x, dst_valid.y, dst_valid.z, dst_valid.w & ~(GSLocalMemory::m_psm[dst->m_TEX0.PSM].pgs.y - 1));
|
||||
const u32 dst_end_block_rounded = GSLocalMemory::GetEndBlockAddress(dst->m_TEX0.TBP0, dst->m_TEX0.TBW, dst->m_TEX0.PSM, dst_valid_rounded) + 1;
|
||||
bool delete_target = (static_cast<int>(dst_end_block_rounded - old_dst->m_TEX0.TBP0) / 16) >= 1;
|
||||
|
||||
if (height_adjust < old_dst->m_unscaled_size.y && delete_target)
|
||||
{
|
||||
old_dst->m_TEX0.TBP0 = GSLocalMemory::GetStartBlockAddress(old_dst->m_TEX0.TBP0, old_dst->m_TEX0.TBW, old_dst->m_TEX0.PSM, GSVector4i(0, height_adjust, old_dst->m_valid.z, old_dst->m_valid.w));
|
||||
old_dst->m_valid.w -= height_adjust;
|
||||
|
||||
Reference in New Issue
Block a user