GS/HW: Update the target width to match source in channel shuffle

Also kill an annoying assert
This commit is contained in:
refractionpcsx2 2024-05-29 15:17:00 +01:00
parent 6d67156707
commit 834f12dd55
2 changed files with 7 additions and 3 deletions

View File

@ -2753,7 +2753,11 @@ void GSRendererHW::Draw()
if (rt)
{
m_last_channel_shuffle_fbp = rt->m_TEX0.TBP0;
m_last_channel_shuffle_end_block = rt->m_end_block;
// Urban Chaos goes from Z16 to C32, so let's just use the rt's original end block.
if (GSLocalMemory::m_psm[src->m_from_target_TEX0.PSM].bpp != GSLocalMemory::m_psm[rt->m_TEX0.PSM].bpp)
m_last_channel_shuffle_end_block = rt->m_end_block;
else
m_last_channel_shuffle_end_block = (rt->m_TEX0.TBP0 + (src->m_from_target->m_end_block - src->m_from_target_TEX0.TBP0));
}
}
else
@ -2926,7 +2930,7 @@ void GSRendererHW::Draw()
// The FBW should also be okay, since it's coming from the source.
if (rt)
{
rt->m_TEX0.TBW = std::max(rt->m_TEX0.TBW, FRAME_TEX0.TBW);
rt->m_TEX0.TBW = (m_channel_shuffle && (!PRIM->ABE || IsOpaque() || m_context->ALPHA.IsBlack())) ? FRAME_TEX0.TBW : std::max(rt->m_TEX0.TBW, FRAME_TEX0.TBW);
rt->m_TEX0.PSM = FRAME_TEX0.PSM;
}
if (ds)

View File

@ -845,7 +845,7 @@ GSTextureCache::Source* GSTextureCache::LookupDepthSource(const bool is_depth, c
if (GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
{
pxAssert(GSLocalMemory::m_psm[t->m_TEX0.PSM].depth);
GL_INS("Found target in Depth list BP: %x but is RenderTarget", t->m_TEX0.TBP0);
if (t->m_age == 0)
{
// Perfect Match