summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2012-12-17 19:31:52 +0100
committerNeoBrainX <NeoBrainX@gmail.com>2012-12-17 19:36:31 +0100
commit081131160473868c0deb19358b199a5832c8e71e (patch)
tree2454bfeb966d4b94046d35c359ef12eb9a4989b1 /Source/Core/VideoCommon/Src/TextureCacheBase.cpp
parent4c7b63cf0e333a071498971be66183774ac20beb (diff)
TextureCacheBase: Delete textures completely instead of just invalidating them in ClearRenderTargets.
That's what would've been done in the next TCB::Load() call, anyway. Fixes issue 5742. Additionally, change efb copies to specify 1 as the number of mipmaps because that makes more sense than anything else.
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index a5c390df3d..7c47c35bb6 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -205,8 +205,11 @@ void TextureCache::ClearRenderTargets()
tcend = textures.end();
for (; iter!=tcend; ++iter)
- if (iter->second->type != TCET_EC_DYNAMIC)
- iter->second->type = TCET_NORMAL;
+ if (iter->second->type == TCET_EC_VRAM)
+ {
+ delete iter->second;
+ textures.erase(iter++);
+ }
}
bool TextureCache::CheckForCustomTextureLODs(u64 tex_hash, int texformat, unsigned int levels)
@@ -782,7 +785,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
textures[dstAddr] = entry = g_texture_cache->CreateRenderTargetTexture(scaled_tex_w, scaled_tex_h);
// TODO: Using the wrong dstFormat, dumb...
- entry->SetGeneralParameters(dstAddr, 0, dstFormat, 0);
+ entry->SetGeneralParameters(dstAddr, 0, dstFormat, 1);
entry->SetDimensions(tex_w, tex_h, scaled_tex_w, scaled_tex_h);
entry->SetHashes(TEXHASH_INVALID);
entry->type = TCET_EC_VRAM;