GS/HW: Correct some channel shuffle behaviour for alpha shuffles

This commit is contained in:
refractionpcsx2 2023-12-24 01:43:47 +00:00
parent 9c416bdbc1
commit 4586a12859
1 changed files with 6 additions and 4 deletions

View File

@ -3408,7 +3408,7 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool
// So far 2 games hit this code path. Urban Chaos and Tales of Abyss // So far 2 games hit this code path. Urban Chaos and Tales of Abyss
// UC: will copy depth to green channel // UC: will copy depth to green channel
// ToA: will copy depth to alpha 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 // Green channel is masked
GL_INS("Tales Of Abyss Crazyness (MSB 16b depth to Alpha)"); GL_INS("Tales Of Abyss Crazyness (MSB 16b depth to Alpha)");
@ -3443,13 +3443,15 @@ __ri bool GSRendererHW::EmulateChannelShuffle(GSTextureCache::Target* src, bool
} }
else if (m_cached_ctx.CLAMP.WMS == 3 && ((m_cached_ctx.CLAMP.MAXU & 0x8) == 8)) 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 // MGS3/Kill Zone
GL_INS("Blue channel");
if (test_only) if (test_only)
return true; 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)) else if (m_cached_ctx.CLAMP.WMS == 3 && ((m_cached_ctx.CLAMP.MINU & 0x8) == 0))
{ {