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 !!!
This commit is contained in:
Gregory Hainaut 2016-03-20 18:05:36 +01:00
parent be34b963e9
commit c43b1ac201
2 changed files with 9 additions and 4 deletions

View File

@ -23,6 +23,7 @@
#include "GSTextureCache.h" #include "GSTextureCache.h"
bool s_IS_OPENGL = false; bool s_IS_OPENGL = false;
bool GSTextureCache::m_disable_partial_invalidation = false;
GSTextureCache::GSTextureCache(GSRenderer* r) GSTextureCache::GSTextureCache(GSRenderer* r)
: m_renderer(r) : m_renderer(r)
@ -743,6 +744,9 @@ void GSTextureCache::InvalidateLocalMem(GSOffset* off, const GSVector4i& r)
// note: r.rintersect breaks Wizardry and Chaos Legion // 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 >< // Read(t, t->m_valid) works in all tested games but is very slow in GUST titles ><
if (GSTextureCache::m_disable_partial_invalidation) {
Read(t, r.rintersect(t->m_valid));
} else {
if (r.x == 0 && r.y == 0) // Full screen read? if (r.x == 0 && r.y == 0) // Full screen read?
Read(t, t->m_valid); Read(t, t->m_valid);
else // Block level read? else // Block level read?
@ -750,6 +754,7 @@ void GSTextureCache::InvalidateLocalMem(GSOffset* off, const GSVector4i& r)
} }
} }
} }
}
//GSTextureCache::Target* rt2 = NULL; //GSTextureCache::Target* rt2 = NULL;
//int ymin = INT_MAX; //int ymin = INT_MAX;

View File

@ -116,7 +116,7 @@ protected:
uint8* m_temp; uint8* m_temp;
bool m_can_convert_depth; bool m_can_convert_depth;
int m_crc_hack_level; 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 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); virtual Target* CreateTarget(const GIFRegTEX0& TEX0, int w, int h, int type);