From ffddfd8662bda4fedcfcc8cad73f02bd7a522925 Mon Sep 17 00:00:00 2001 From: degasus Date: Sat, 22 Dec 2012 17:30:13 +0100 Subject: 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 --- Source/Core/VideoCommon/Src/TextureCacheBase.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp') diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp index 7c47c35bb6..2bcaead19c 100644 --- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp @@ -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(); -- cgit v1.2.3