summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authormimimi085181 <mimimi085181@gmail.com>2015-10-11 20:11:12 +0200
committermimimi085181 <mimimi085181@gmail.com>2015-10-15 00:45:55 +0200
commitaf28934703c2f953d2e8281b0dbd4fe9e21954cf (patch)
tree1d5687dfd5ad2eaf46f168f3e5df81e31567c575 /Source/Core/VideoCommon/TextureCacheBase.cpp
parentb0bbe52cc96c8182dc46dec20c10d14f05a133db (diff)
Do not delete strided efb copies on load
This hopefully allows to use partial texture updates with strided efb copies that start at the same offset as the loaded texture
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 1d9b564a8f..724d86b433 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -471,7 +471,9 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
while (iter != iter_range.second)
{
TCacheEntryBase* entry = iter->second;
- if (entry->IsEfbCopy())
+ // Do not load strided EFB copies, they are not meant to be used directly
+ if (entry->IsEfbCopy() && entry->native_width == nativeW && entry->native_height == nativeH &&
+ entry->memory_stride == entry->CacheLinesPerRow() * 32)
{
// EFB copies have slightly different rules as EFB copy formats have different
// meanings from texture formats.
@@ -517,8 +519,9 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
// textures as the same texture here, when the texture itself is the same. This
// improves the performance a lot in some games that use paletted textures.
// Example: Sonic the Fighters (inside Sonic Gems Collection)
+ // Skip EFB copies here, so they can be used for partial texture updates
if (entry->frameCount != FRAMECOUNT_INVALID && entry->frameCount < temp_frameCount &&
- !(isPaletteTexture && entry->base_hash == base_hash))
+ !entry->IsEfbCopy() && !(isPaletteTexture && entry->base_hash == base_hash))
{
temp_frameCount = entry->frameCount;
oldest_entry = iter;