Skip to content

Commit 1720a3c

Browse files
GS/TC+CRC: Check valid alpha channels on 24 bit target on inside lookup
1 parent 188714c commit 1720a3c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pcsx2/GS/Renderers/HW/GSHwHack.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,8 @@ bool GSHwHack::GSC_PolyphonyDigitalGames(GSRendererHW& r, int& skip)
803803
dst->m_alpha_min = 0;
804804
dst->m_alpha_max = 255;
805805
dst->m_alpha_range = true;
806+
dst->m_valid_alpha_high = true;
807+
dst->m_valid_alpha_low = true;
806808
dst->UpdateValidChannels(PSMCT32, fbmsk);
807809
dst->UpdateValidity(GSVector4i::loadh(size));
808810

pcsx2/GS/Renderers/HW/GSTextureCache.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,8 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
18101810
// Keep note that 2 bw is basically 1 normal page, as bw is in 64 pixels, and 8bit pages are 128 pixels wide, aka 2 bw.
18111811
// Also check for 4HH/HL and 8H which use the alpha channel, if the page order is wrong this can cause problems as well (Jak X font).
18121812
else if (!possible_shuffle && GSLocalMemory::m_psm[psm].trbpp <= 8 &&
1813-
(GSUtil::GetChannelMask(t->m_TEX0.PSM) != 0xF ||
1813+
((GSUtil::GetChannelMask(t->m_TEX0.PSM) != GSUtil::GetChannelMask(psm) &&
1814+
!(((GSUtil::GetChannelMask(psm) & 0x7) == 0 || t->m_valid_rgb) && ((GSUtil::GetChannelMask(psm) & 0x8) == 0 || (t->m_valid_alpha_low && t->m_valid_alpha_high)))) ||
18141815
((GSLocalMemory::m_psm[t->m_TEX0.PSM].bpp != 16 || GSLocalMemory::m_psm[psm].bpp < 16) &&
18151816
(!(block_boundary_rect.w <= GSLocalMemory::m_psm[psm].pgs.y &&
18161817
((GSLocalMemory::m_psm[psm].bpp == 32) ? bw : ((bw + 1) / 2)) <= t->m_TEX0.TBW) &&

0 commit comments

Comments
 (0)