gsdx-tc: add UserHacks_DisablePartialInvalidation for snowblind engine game

Games uses very special texture with a lots of repeating.

It is much faster to send the full texture rather than trying to partially invalidate it.

On my gs dump:
FPS: 29 => 68 !
This commit is contained in:
Gregory Hainaut 2016-03-19 00:23:00 +01:00
parent eb69522641
commit 46a4d2dc47
2 changed files with 21 additions and 14 deletions

View File

@ -37,6 +37,7 @@ GSTextureCache::GSTextureCache(GSRenderer* r)
m_preload_frame = userhacks && theApp.GetConfig("preload_frame_with_gs_data", 0); m_preload_frame = userhacks && theApp.GetConfig("preload_frame_with_gs_data", 0);
m_can_convert_depth = s_IS_OPENGL && theApp.GetConfig("texture_cache_depth", 1); m_can_convert_depth = s_IS_OPENGL && theApp.GetConfig("texture_cache_depth", 1);
m_crc_hack_level = theApp.GetConfig("crc_hack_level", 3); m_crc_hack_level = theApp.GetConfig("crc_hack_level", 3);
m_disable_partial_invalidation = userhacks && theApp.GetConfig("UserHacks_DisablePartialInvalidation", 0);
// In theory 4MB is enough but 9MB is safer for overflow (8MB // In theory 4MB is enough but 9MB is safer for overflow (8MB
// isn't enough in custom resolution) // isn't enough in custom resolution)
@ -577,24 +578,29 @@ void GSTextureCache::InvalidateVideoMem(GSOffset* off, const GSVector4i& rect, b
if(!s->m_target) if(!s->m_target)
{ {
// Invalidate data of input texture if (m_disable_partial_invalidation && s->m_repeating) {
if(s->m_repeating) m_src.RemoveAt(s);
{ } else {
vector<GSVector2i>& l = s->m_p2t[page]; // Invalidate data of input texture
if(s->m_repeating)
for(vector<GSVector2i>::iterator k = l.begin(); k != l.end(); k++)
{ {
valid[k->x] &= k->y; // Note: very hot path on snowbling engine game
vector<GSVector2i>& l = s->m_p2t[page];
for(vector<GSVector2i>::iterator k = l.begin(); k != l.end(); k++)
{
valid[k->x] &= k->y;
}
}
else
{
valid[page] = 0;
} }
}
else
{
valid[page] = 0;
}
s->m_complete = false; s->m_complete = false;
found |= b; found |= b;
}
} }
else else
{ {

View File

@ -116,6 +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;
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);