Skip to content

Commit

Permalink
GS/HW: Check channel coverage on targets if it should draw during cle…
Browse files Browse the repository at this point in the history
…ars.

No fixes noticed, some games gained copies, needs more testing.
  • Loading branch information
lightningterror committed Jan 6, 2025
1 parent 4f7c8a7 commit 3acb81f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2358,12 +2358,12 @@ void GSRendererHW::Draw()
(no_rt || height_invalid ||
(tgt = g_texture_cache->GetExactTarget(m_cached_ctx.FRAME.Block(), m_cached_ctx.FRAME.FBW,
GSTextureCache::RenderTarget, rt_end_bp)) == nullptr ||
m_r.rintersect(tgt->m_valid).eq(tgt->m_valid));
m_r.rintersect(tgt->m_valid).eq(tgt->m_valid) && GSUtil::GetChannelMask(m_cached_ctx.FRAME.PSM) >= GSUtil::GetChannelMask(tgt->m_TEX0.PSM));
const bool overwriting_whole_ds =
(no_ds || height_invalid ||
(tgt = g_texture_cache->GetExactTarget(m_cached_ctx.ZBUF.Block(), m_cached_ctx.FRAME.FBW,
GSTextureCache::DepthStencil, ds_end_bp)) == nullptr ||
m_r.rintersect(tgt->m_valid).eq(tgt->m_valid));
m_r.rintersect(tgt->m_valid).eq(tgt->m_valid) && GSUtil::GetChannelMask(m_cached_ctx.ZBUF.PSM) >= GSUtil::GetChannelMask(tgt->m_TEX0.PSM));

if (overwriting_whole_rt && overwriting_whole_ds &&
TryGSMemClear(no_rt, preserve_rt_color, is_zero_color_clear, rt_end_bp,
Expand Down

0 comments on commit 3acb81f

Please sign in to comment.