From bc31415bfcc7f5445f5aec0ade674a05ff236e9f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 25 Mar 2017 15:30:58 -0700 Subject: [PATCH] Texcache: Fix "reuse changed textures". Broken by 9876365, which stopped generating new texture names/ptrs. --- GPU/Common/TextureCacheCommon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 5e5fc7c098..f22026e348 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -1486,6 +1486,9 @@ bool TextureCacheCommon::CheckFullHash(TexCacheEntry *entry, bool &doDelete) { secondCacheSizeEstimate_ += EstimateTexMemoryUsage(entry); // Is this wise? We simply copy the entry. secondCache_[secondKey].reset(new TexCacheEntry(*entry)); + + // Make sure we don't delete the texture we just copied. + entry->texturePtr = nullptr; doDelete = false; } }