summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/Src/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/TextureCacheBase.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
index fda4f21a7e..319c014f22 100644
--- a/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
+++ b/Source/Core/VideoCommon/Src/TextureCacheBase.cpp
@@ -56,7 +56,7 @@ TextureCache::TextureCache()
if (!temp)
temp = (u8*)AllocateAlignedMemory(temp_size, 16);
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
- if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
+ if(g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
HiresTextures::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str());
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
}
@@ -129,7 +129,10 @@ 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
+ && ! iter->second->IsEfbCopy() )
{
delete iter->second;
textures.erase(iter++);
@@ -722,7 +725,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
case 1: // R8
case 8: // R8
colmat[0] = colmat[4] = colmat[8] = colmat[12] = 1;
- cbufid = 13;
+ cbufid = 13;
break;
case 2: // RA4
@@ -743,11 +746,11 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
case 9: // G8
colmat[1] = colmat[5] = colmat[9] = colmat[13] = 1.0f;
- cbufid = 17;
+ cbufid = 17;
break;
case 10: // B8
colmat[2] = colmat[6] = colmat[10] = colmat[14] = 1.0f;
- cbufid = 18;
+ cbufid = 18;
break;
case 11: // RG8
@@ -756,7 +759,7 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
break;
case 12: // GB8
- colmat[1] = colmat[5] = colmat[9] = colmat[14] = 1.0f;
+ colmat[1] = colmat[5] = colmat[9] = colmat[14] = 1.0f;
cbufid = 20;
break;
@@ -828,9 +831,5 @@ void TextureCache::CopyRenderTargetToTexture(u32 dstAddr, unsigned int dstFormat
entry->frameCount = frameCount;
- g_renderer->ResetAPIState(); // reset any game specific settings
-
entry->FromRenderTarget(dstAddr, dstFormat, srcFormat, srcRect, isIntensity, scaleByHalf, cbufid, colmat);
-
- g_renderer->RestoreAPIState();
}