From 4e8ff4250320308a8ddf1105397aa7273c5c32fd Mon Sep 17 00:00:00 2001 From: mimimi085181 Date: Wed, 12 Jul 2017 22:49:06 +0200 Subject: [PATCH] Do not load overwritten textures by hash In this case, comparing the hash is not enough to check, if two textures are identical. --- Source/Core/VideoCommon/TextureCacheBase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index ce87a8c767..756b8c22e4 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -1326,6 +1326,14 @@ void TextureCacheBase::CopyRenderTargetToTexture(u32 dstAddr, EFBCopyFormat dstF continue; } entry->may_have_overlapping_textures = true; + + // Do not load textures by hash, if they were at least partly overwritten by an efb copy. + // In this case, comparing the hash is not enough to check, if two textures are identical. + if (entry->textures_by_hash_iter != textures_by_hash.end()) + { + textures_by_hash.erase(entry->textures_by_hash_iter); + entry->textures_by_hash_iter = textures_by_hash.end(); + } } ++iter.first; }