From 7ee91124255b19b52f2b571444ccac76f65d3fa0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 15 Mar 2015 09:10:09 -0700 Subject: [PATCH] Avoid constant reload of frequently changed tex. If we detect that it's frequently changing, this will cause it to spiral into an infinite loop of staying frequently changing and reloading to try to scale. --- GPU/Directx9/TextureCacheDX9.cpp | 6 ++++-- GPU/GLES/TextureCache.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 7778b2956c..c67aace6f9 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -1212,8 +1212,10 @@ void TextureCacheDX9::SetTexture(bool force) { } if (match && (entry->status & TexCacheEntry::STATUS_TO_SCALE) && g_Config.iTexScalingLevel != 1 && texelsScaledThisFrame_ < TEXCACHE_MAX_TEXELS_SCALED) { - // INFO_LOG(G3D, "Reloading texture to do the scaling we skipped.."); - match = false; + if ((entry->status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { + // INFO_LOG(G3D, "Reloading texture to do the scaling we skipped.."); + match = false; + } } if (match) { diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 599e3297a9..c55d274a3b 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -1385,8 +1385,10 @@ void TextureCache::SetTexture(bool force) { } if (match && (entry->status & TexCacheEntry::STATUS_TO_SCALE) && g_Config.iTexScalingLevel != 1 && texelsScaledThisFrame_ < TEXCACHE_MAX_TEXELS_SCALED) { - // INFO_LOG(G3D, "Reloading texture to do the scaling we skipped.."); - match = false; + if ((entry->status & TexCacheEntry::STATUS_CHANGE_FREQUENT) == 0) { + // INFO_LOG(G3D, "Reloading texture to do the scaling we skipped.."); + match = false; + } } if (match) {