Skip to content

Commit

Permalink
GS/HW: Correct some channel shuffle behaviour for alpha shuffles
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Dec 24, 2023
1 parent fdc0370 commit 8694fdb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pcsx2/GS/Renderers/HW/GSRendererHW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3373,7 +3373,7 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool
// So far 2 games hit this code path. Urban Chaos and Tales of Abyss
// UC: will copy depth to green channel
// ToA: will copy depth to alpha channel
if ((m_cached_ctx.FRAME.FBMSK & 0xFF0000) == 0xFF0000)
if ((m_cached_ctx.FRAME.FBMSK & 0x00FF0000) == 0x00FF0000)
{
// Green channel is masked
GL_INS("Tales Of Abyss Crazyness (MSB 16b depth to Alpha)");
Expand Down Expand Up @@ -3408,13 +3408,15 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool
}
else if (m_cached_ctx.CLAMP.WMS == 3 && ((m_cached_ctx.CLAMP.MAXU & 0x8) == 8))
{
// Read either blue or Alpha. Let's go for Blue ;)
// MGS3/Kill Zone
GL_INS("Blue channel");
if (test_only)
return true;

m_conf.ps.channel = ChannelFetch_BLUE;
ChannelFetch channel_select = (m_cached_ctx.CLAMP.WMT != 3 || (m_cached_ctx.CLAMP.WMT == 3 && ((m_cached_ctx.CLAMP.MAXV & 0x2) == 0))) ? ChannelFetch_BLUE : ChannelFetch_ALPHA;

GL_INS("%s channel", (channel_select == ChannelFetch_BLUE) ? "blue" : "alpha");

m_conf.ps.channel = channel_select;
}
else if (m_cached_ctx.CLAMP.WMS == 3 && ((m_cached_ctx.CLAMP.MINU & 0x8) == 0))
{
Expand Down

0 comments on commit 8694fdb

Please sign in to comment.