From 1141af64f64b801fc1509bb9c1eff92436f340e6 Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Mon, 25 Feb 2013 12:36:50 +0000 Subject: [PATCH] TextureCacheBase: Do not assume EFB copies can safely be deleted when we think they're "unused". Fixes issue 6040. --- Source/Core/VideoCommon/Src/TextureCacheBase.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp index fda4f21a7e..46aaf79bd4 100644 --- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp @@ -129,8 +129,13 @@ void TextureCache::Cleanup() TexCache::iterator tcend = textures.end(); while (iter != tcend) { - if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second->frameCount) // TODO: Deleting EFB copies might not be a good idea here... + if (frameCount > TEXTURE_KILL_THRESHOLD + iter->second->frameCount) { + // EFB copies living on the host GPU are unrecoverable and thus shouldn't be deleted + // TODO: encoding the texture back to RAM here might be a good idea + if (g_ActiveConfig.bCopyEFBToTexture && entry->IsEfbCopy()) + continue; + delete iter->second; textures.erase(iter++); }