Skip to content

Commit

Permalink
GS/HW: Check for format combinations that make sense for CSBW
Browse files Browse the repository at this point in the history
True Crime: New York City strikes again...
  • Loading branch information
stenzek committed Apr 25, 2024
1 parent ece8905 commit 9f1483f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6222,6 +6222,14 @@ bool GSRendererHW::CanUseSwPrimRender(bool no_rt, bool no_ds, bool draw_sprite_t
if (!rc.GetDirtyRect(m_cached_ctx.TEX0, false).rintersect(tr).rempty())
return true;
}

// Make sure it actually makes sense to use this target as a source, given the formats, and it wouldn't just sample as garbage.
// We can't rely exclusively on the dirty rect check above, because sometimes the targets are from older frames and too large.
if (!GSUtil::HasSameSwizzleBits(m_cached_ctx.TEX0.PSM, src_target->m_TEX0.PSM) &&
(!src_target->m_32_bits_fmt || GSLocalMemory::m_psm[m_cached_ctx.TEX0.PSM].bpp != 16))
{
return true;
}
}

return false;
Expand Down

0 comments on commit 9f1483f

Please sign in to comment.