From ca943f070c9f6edc10f3991c83afb2fe1255b7f1 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 10 Feb 2013 14:14:20 -0800 Subject: [PATCH] Don't delete cache invalidated textures. Note: still decimates. --- GPU/GLES/TextureCache.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index a71de7717..d734faf90 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -79,7 +79,7 @@ void TextureCache::Invalidate(u32 addr, int size, bool force) { addr &= 0xFFFFFFF; u32 addr_end = addr + size; - for (TexCache::iterator iter = cache.begin(), end = cache.end(); iter != end; ) { + for (TexCache::iterator iter = cache.begin(), end = cache.end(); iter != end; ++iter) { u32 texAddr = iter->second.addr; u32 texEnd = iter->second.addr + iter->second.sizeInRAM; // Clear if either the addr or clutaddr is in the range. @@ -94,25 +94,16 @@ void TextureCache::Invalidate(u32 addr, int size, bool force) { } if (force) { gpuStats.numTextureInvalidations++; - glDeleteTextures(1, &iter->second.texture); - cache.erase(iter++); + iter->second.status = TexCacheEntry::STATUS_UNRELIABLE; } else { iter->second.invalidHint++; - ++iter; } } - else - ++iter; } } void TextureCache::InvalidateAll(bool force) { - if (force) { - gpuStats.numTextureInvalidations += 1000; - Clear(true); - } - else - Invalidate(0, 0xFFFFFFFF, force); + Invalidate(0, 0xFFFFFFFF, force); } TextureCache::TexCacheEntry *TextureCache::GetEntryAt(u32 texaddr) { @@ -778,6 +769,7 @@ void TextureCache::SetTexture() { u32 check = QuickTexHash(texaddr, bufw, w, h, format); if (check != entry->fullhash) { match = false; + gpuStats.numTextureInvalidations++; entry->status = TexCacheEntry::STATUS_UNRELIABLE; } }