do only invalid hashes instead of all textures on loading

this is a hack, but only the gpu thread is allowed to call ogl commands
suggestion: create an unused texture cache, so we can move all textures there
This commit is contained in:
degasus
2012-12-22 17:30:13 +01:00
parent 2df0c31d13
commit ffddfd8662
3 changed files with 14 additions and 1 deletions

View File

@ -72,6 +72,18 @@ void TextureCache::Invalidate()
textures.clear();
}
// this function is dirty hack to work around a OGL bug.
// it is only used on loading states. It will work for normal textures,
// but for efb2ram, it wouldn't be checked. So there may be glitches on loading
void TextureCache::InvalidateHashes()
{
TexCache::iterator
iter = textures.begin(),
tcend = textures.end();
for (; iter != tcend; ++iter)
iter->second->hash = TEXHASH_INVALID;
}
TextureCache::~TextureCache()
{
Invalidate();