From 85e899b92c33d09e12357a7dc817da2816fbbf6c Mon Sep 17 00:00:00 2001 From: refractionpcsx2 Date: Fri, 9 Feb 2024 10:52:00 +0000 Subject: [PATCH] GS/HW: Only allow tex is fb on alpha if draw is recursive --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 06686eac0d..4d7e5304a1 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -4914,7 +4914,10 @@ bool GSRendererHW::CanUseTexIsFB(const GSTextureCache::Target* rt, const GSTextu // This pattern is used by several games to emulate a stencil (shadow) // Ratchet & Clank, Jak do alpha integer multiplication (tfx) which is mostly equivalent to +1/-1 // Tri-Ace (Star Ocean 3/RadiataStories/VP2) uses a palette to handle the +1/-1 - if (m_cached_ctx.FRAME.FBMSK == 0x00FFFFFF) + // Update: This isn't really needed anymore, if you use autoflush, however there's a reasonable speed impact (about 30%) in not using this. + // Added the diff check to make sure it's reading the same data seems to be fine for Jak, VP2, Star Ocean, without breaking X2: Wolverine, which broke without that check. + const GSVector4 diff(m_vt.m_min.p.upld(m_vt.m_max.p) - m_vt.m_min.t.upld(m_vt.m_max.t)); + if (m_cached_ctx.FRAME.FBMSK == 0x00FFFFFF && (diff.abs() < GSVector4(1.0f)).alltrue()) { GL_CACHE("Tex-is-fb hack for Jak"); return true;