Fix #4922, kill age checks in texcache.

This commit is contained in:
Unknown W. Brackets committed 2014-01-01 15:49:10 -08:00
1 parent e24f45b9a4
commit e477c50ea1
1 file changed
+3 -2
+3 -2
View File
@@ -103,7 +103,7 @@ void TextureCache::Decimate() {
lastBoundTexture = -1;
int killAge = lowMemoryMode_ ? TEXTURE_KILL_AGE_LOWMEM : TEXTURE_KILL_AGE;
for (TexCache::iterator iter = cache.begin(); iter != cache.end(); ) {
if (iter->second.lastFrame + TEXTURE_KILL_AGE < gpuStats.numFlips) {
if (iter->second.lastFrame + killAge < gpuStats.numFlips) {
glDeleteTextures(1, &iter->second.texture);
cache.erase(iter++);
} else {
@@ -113,7 +113,8 @@ void TextureCache::Decimate() {
if (g_Config.bTextureSecondaryCache) {
for (TexCache::iterator iter = secondCache.begin(); iter != secondCache.end(); ) {
if (lowMemoryMode_ || iter->second.lastFrame + TEXTURE_KILL_AGE < gpuStats.numFlips) {
// In low memory mode, we kill them all.
if (lowMemoryMode_ || iter->second.lastFrame + TEXTURE_SECOND_KILL_AGE < gpuStats.numFlips) {
glDeleteTextures(1, &iter->second.texture);
secondCache.erase(iter++);
} else {