GS/HW: Ensure valid alpha doesn't get cleared on 24-bit targets

This commit is contained in:
Connor McLaughlin 2024-04-27 16:43:41 +10:00
parent 85a33971e7
commit f5c3cd0f87
1 changed files with 9 additions and 5 deletions

View File

@ -2646,12 +2646,16 @@ void GSRendererHW::Draw()
return; return;
} }
} }
}
if (rt && m_channel_shuffle) // The target might have previously been a C32 format with valid alpha. If we're switching to C24, we need to preserve it.
{ preserve_rt_alpha |= (GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].trbpp == 24 && rt->HasValidAlpha());
m_last_channel_shuffle_fbp = rt->m_TEX0.TBP0; preserve_rt_color = preserve_rt_rgb || preserve_rt_alpha;
m_last_channel_shuffle_end_block = rt->m_end_block;
if (m_channel_shuffle)
{
m_last_channel_shuffle_fbp = rt->m_TEX0.TBP0;
m_last_channel_shuffle_end_block = rt->m_end_block;
}
} }
GSTextureCache::Target* ds = nullptr; GSTextureCache::Target* ds = nullptr;