From c43b1ac201f9b2ca57035b3d0aa3cfc15944c5b8 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 20 Mar 2016 18:05:36 +0100 Subject: [PATCH] gsdx tc: extend the fast invalidation hack to limit the size of target read It actually removes the previous hack that read the full target. Unfortunately snowblind engine game uses big target so the read is very big too (1280x448) which is killer for the perf. Whereas the game requires only 24x12 texels Give a 2x speed boost on Champion of Norrath !!! --- plugins/GSdx/GSTextureCache.cpp | 11 ++++++++--- plugins/GSdx/GSTextureCache.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index d9ea1bcacf..17e661baa4 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -23,6 +23,7 @@ #include "GSTextureCache.h" bool s_IS_OPENGL = false; +bool GSTextureCache::m_disable_partial_invalidation = false; GSTextureCache::GSTextureCache(GSRenderer* r) : m_renderer(r) @@ -743,10 +744,14 @@ void GSTextureCache::InvalidateLocalMem(GSOffset* off, const GSVector4i& r) // note: r.rintersect breaks Wizardry and Chaos Legion // Read(t, t->m_valid) works in all tested games but is very slow in GUST titles >< - if (r.x == 0 && r.y == 0) // Full screen read? - Read(t, t->m_valid); - else // Block level read? + if (GSTextureCache::m_disable_partial_invalidation) { Read(t, r.rintersect(t->m_valid)); + } else { + if (r.x == 0 && r.y == 0) // Full screen read? + Read(t, t->m_valid); + else // Block level read? + Read(t, r.rintersect(t->m_valid)); + } } } } diff --git a/plugins/GSdx/GSTextureCache.h b/plugins/GSdx/GSTextureCache.h index 9138b8edcd..dbd9a430eb 100644 --- a/plugins/GSdx/GSTextureCache.h +++ b/plugins/GSdx/GSTextureCache.h @@ -116,7 +116,7 @@ protected: uint8* m_temp; bool m_can_convert_depth; int m_crc_hack_level; - bool m_disable_partial_invalidation; + static bool m_disable_partial_invalidation; virtual Source* CreateSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, Target* t = NULL, bool half_right = false); virtual Target* CreateTarget(const GIFRegTEX0& TEX0, int w, int h, int type);