From 6c6ed5f44313530d353859d89e652a850438f24d Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 25 Sep 2016 10:05:44 +0200 Subject: [PATCH] gsdx ogl: trigger the special RW framebuffer shader when only Alpha is written (#1588) * gsdx ogl: trigger the special RW framebuffer shader when only Alpha is written It will work for both Jak and Ratchet&Clank and without CRC --- plugins/GSdx/GSCrc.cpp | 6 ------ plugins/GSdx/GSCrc.h | 4 ---- plugins/GSdx/GSRendererOGL.cpp | 3 ++- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/plugins/GSdx/GSCrc.cpp b/plugins/GSdx/GSCrc.cpp index 91eb74902f..f6b4dd700a 100644 --- a/plugins/GSdx/GSCrc.cpp +++ b/plugins/GSdx/GSCrc.cpp @@ -515,12 +515,6 @@ CRC::Game CRC::m_games[] = {0XE1BF5DCA, SuperManReturns, US, 0}, {0x06A7506A, SacredBlaze, JP, 0}, {0x4CE7FB04, ItadakiStreet, JP, 0}, - {0x9C712FF0, Jak1, EU, 0}, - {0x472E7699, Jak1, US, 0}, - {0x2479F4A9, Jak2, EU, 0}, - {0x12804727, Jak3, EU, 0}, - {0x644CFD03, Jak3, US, 0}, - {0xDF659E77, JakX, EU, 0}, }; map CRC::m_map; diff --git a/plugins/GSdx/GSCrc.h b/plugins/GSdx/GSCrc.h index 2ad2c2adb0..5ee7ceba4b 100644 --- a/plugins/GSdx/GSCrc.h +++ b/plugins/GSdx/GSCrc.h @@ -175,10 +175,6 @@ public: SacredBlaze, SuperManReturns, ItadakiStreet, - Jak1, - Jak2, - Jak3, - JakX, TitleCount, }; diff --git a/plugins/GSdx/GSRendererOGL.cpp b/plugins/GSdx/GSRendererOGL.cpp index d63b3aeafb..8acfd2ee00 100644 --- a/plugins/GSdx/GSRendererOGL.cpp +++ b/plugins/GSdx/GSRendererOGL.cpp @@ -1155,7 +1155,8 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour // Always check if primitive overlap. The function will return PRIM_OVERLAP_UNKNOW for non sprite primitive m_prim_overlap = PrimitiveOverlap(); if ((m_context->FRAME.Block() == m_context->TEX0.TBP0) && PRIM->TME && m_sw_blending && (m_prim_overlap != PRIM_OVERLAP_NO) && (m_vertex.next > 2)) { - if (m_game.title == CRC::Jak1 || m_game.title == CRC::Jak2 || m_game.title == CRC::Jak3 || m_game.title == CRC::JakX) { + if (m_context->FRAME.FBMSK == 0x00FFFFFF) { + // Ratchet & Clank / Jak uses this pattern to compute the shadows. Alpha (multiplication) tfx is mostly equivalent to -1/+1 stencil operation GL_INS("ERROR: Source and Target are the same! Let's sample the framebuffer"); m_ps_sel.tex_is_fb = 1; m_require_full_barrier = true;