summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2014-10-28 14:47:13 +0100
committerJules Blok <jules.blok@gmail.com>2014-11-23 14:23:42 +0100
commit5944d15021e39f2356f7fbe1b6a935426bc0bb8a (patch)
tree5ed47117b75c0d7faaa53e9344bbc986fb273ee3 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent272ea90ca5e7a7f2c6e9a101b7b9e899b2757a70 (diff)
TextureCache: Check the number of layers before reusing a texture.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 0618b3f1b9..d4296cc2aa 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -444,14 +444,15 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
//
// TODO: Don't we need to force texture decoding to RGBA8 for dynamic EFB copies?
// TODO: Actually, it should be enough if the internal texture format matches...
- if ((entry->type == TCET_NORMAL &&
+ if (((entry->type == TCET_NORMAL &&
width == entry->virtual_width &&
height == entry->virtual_height &&
full_format == entry->format &&
entry->num_mipmaps > maxlevel) ||
(entry->type == TCET_EC_DYNAMIC &&
entry->native_width == width &&
- entry->native_height == height))
+ entry->native_height == height)) &&
+ entry->num_layers == 1)
{
// reuse the texture
}
@@ -519,6 +520,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int const stage,
// But that will currently make the above "existing entry" tests fail as "texLevels" is not calculated until after.
// Currently, we might try to reuse a texture which appears to have more levels than actual, maybe..
entry->num_mipmaps = maxlevel + 1;
+ entry->num_layers = 1;
entry->type = TCET_NORMAL;
GFX_DEBUGGER_PAUSE_AT(NEXT_NEW_TEXTURE, true);