summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authormimimi085181 <mimimi085181@gmail.com>2017-07-12 22:49:06 +0200
committermimimi085181 <mimimi085181@gmail.com>2017-08-06 03:13:57 +0200
commit4e8ff4250320308a8ddf1105397aa7273c5c32fd (patch)
treeeab7e6fb36c9cae3d1f54baec565b2d000236fb7 /Source/Core/VideoCommon/TextureCacheBase.cpp
parenta21ac22e0786c538ea94d3631ece39c2ba07b771 (diff)
Do not load overwritten textures by hash
In this case, comparing the hash is not enough to check, if two textures are identical.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp8
1 files changed, 8 insertions, 0 deletions
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;
}