From ad86bb5faae8d7bc26a4e83b2364d387b3e5cc33 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 9 Jul 2015 23:03:55 +0200 Subject: [PATCH] gsdx-tc: clear 32 bits state after vsync Avoid issue on game that uses only 16 bits RT --- plugins/GSdx/GSTextureCache.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 0e2399651d..8dfe36bac5 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -432,9 +432,6 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int } dst->m_used = true; - // Frame is always 32 bits. However target could be reused for standard RT. If the - // game uses a 16 bits RT (ricky cricket), you will be screwed - dst->m_32_bits_fmt = false; return dst; } @@ -788,6 +785,12 @@ void GSTextureCache::IncAge() Target* t = *j; + // This variable is used to detect the texture shuffle effect. There is a high + // probability that game will do it on the current RT. + // Variable is cleared here to avoid issue with game that uses a 16 bits + // render target + t->m_32_bits_fmt = false; + if(++t->m_age > maxage) { m_dst[type].erase(j); @@ -843,8 +846,9 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con } #endif - if (TEX0.PSM < PSM_PSMT8 || TEX0.PSM > PSM_PSMT4HH) + if (TEX0.PSM < PSM_PSMT8 || TEX0.PSM > PSM_PSMT4HH) { src->m_32_bits_fmt = dst->m_32_bits_fmt; + } src->m_target = true; dst->Update();