Skip to content

Commit

Permalink
GS/HW: Ensure valid alpha doesn't get cleared on 24-bit targets
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Apr 27, 2024
1 parent 9f1483f commit e1ca3c0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2631,12 +2631,16 @@ void GSRendererHW::Draw()
return;
}
}
}

if (rt && m_channel_shuffle)
{
m_last_channel_shuffle_fbp = rt->m_TEX0.TBP0;
m_last_channel_shuffle_end_block = rt->m_end_block;
// 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());
preserve_rt_color = preserve_rt_rgb || preserve_rt_alpha;

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;
Expand Down

0 comments on commit e1ca3c0

Please sign in to comment.