GS/HW: Don't allow PCRTC frames pull RGB from depth

This commit is contained in:
refractionpcsx2 2023-09-15 10:23:51 +01:00
parent 30e3a3a958
commit da8db72328
1 changed files with 15 additions and 10 deletions

View File

@ -1801,6 +1801,10 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(GIFRegTEX0 TEX0, const GSVe
if (type == RenderTarget && (preserve_target || !dst->m_valid.rintersect(draw_rect).eq(dst->m_valid)) && if (type == RenderTarget && (preserve_target || !dst->m_valid.rintersect(draw_rect).eq(dst->m_valid)) &&
!dst->m_valid_rgb && !FullRectDirty(dst, 0x7) && !dst->m_valid_rgb && !FullRectDirty(dst, 0x7) &&
(GSLocalMemory::m_psm[TEX0.PSM].trbpp < 24 || fbmask != 0x00FFFFFFu)) (GSLocalMemory::m_psm[TEX0.PSM].trbpp < 24 || fbmask != 0x00FFFFFFu))
{
// Neo Contra clears 0x1400 with Z16S, then uses that address to upload C32 frames, this gets confused and makes a mess of it.
// TODO: Look in to making sure bad format conversions don't happen.
if (!is_frame)
{ {
GL_CACHE("TC: Attempt to repopulate RGB for %s[%x]", to_string(type), dst->m_TEX0.TBP0); GL_CACHE("TC: Attempt to repopulate RGB for %s[%x]", to_string(type), dst->m_TEX0.TBP0);
for (Target* dst_match : m_dst[DepthStencil]) for (Target* dst_match : m_dst[DepthStencil])
@ -1816,6 +1820,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(GIFRegTEX0 TEX0, const GSVe
break; break;
} }
}
if (!dst->m_valid_rgb) if (!dst->m_valid_rgb)
{ {