summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authormimimi085181 <mimimi085181@gmail.com>2016-03-31 19:38:30 +0200
committermimimi085181 <mimimi085181@gmail.com>2016-04-02 20:34:49 +0200
commitbefb2e4809fc06f7c93b80ae0873f3411f26ad21 (patch)
tree74d10c19f7f30650692733ef8346a85c584c1bad /Source/Core/VideoCommon/TextureCacheBase.cpp
parent57e40445a1d9fc82632c818d80e26cea046caa22 (diff)
Partial texture updates: Allow the efb copy to start before the texture
This is an oversight from pr https://github.com/dolphin-emu/dolphin/pull/3266 . Thanks to degasus for pointing this out. It's possible that MAX_TEXTURE_BINARY_SIZE can be optimised, but i wanted to play it safe considering the 5.0 stable release.
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp
index 1707be49cb..456883bc8d 100644
--- a/Source/Core/VideoCommon/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/TextureCacheBase.cpp
@@ -37,6 +37,7 @@ static const u64 TEXHASH_INVALID = 0;
static const int TEXTURE_KILL_THRESHOLD = 64; // Sonic the Fighters (inside Sonic Gems Collection) loops a 64 frames animation
static const int TEXTURE_POOL_KILL_THRESHOLD = 3;
static const int FRAMECOUNT_INVALID = 0;
+static const u64 MAX_TEXTURE_BINARY_SIZE = 1024 * 1024 * 4; // 1024 x 1024 texel times 8 nibbles per texel
std::unique_ptr<TextureCacheBase> g_texture_cache;
@@ -300,7 +301,7 @@ TextureCacheBase::TCacheEntryBase* TextureCacheBase::DoPartialTextureUpdates(Tex
u32 numBlocksX = (entry_to_update->native_width + block_width - 1) / block_width;
- TexCache::iterator iter = textures_by_address.lower_bound(entry_to_update->addr);
+ TexCache::iterator iter = textures_by_address.lower_bound(entry_to_update->addr > MAX_TEXTURE_BINARY_SIZE ? entry_to_update->addr - MAX_TEXTURE_BINARY_SIZE : 0);
TexCache::iterator iterend = textures_by_address.upper_bound(entry_to_update->addr + entry_to_update->size_in_bytes);
while (iter != iterend)
{