Add an option to toggle caching EFB->RAM copies.

skid_au had implemented this in a previous revision and enabled it by default, but it caused glitches if STC wasn't set to "safe" (which kinda defeated the purpose since it slowed down stuff again).

Also renamed the "safe texture cache" to "accurate texture cache", since setting the "safe" texture cache to "safe" sounds kind of silly..

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6625 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2010-12-20 14:48:46 +00:00
parent bb8918a2ca
commit 60ed57b32a
6 changed files with 45 additions and 22 deletions

View File

@ -442,11 +442,15 @@ u64 EncodeToRamFromTexture(u32 address,LPDIRECT3DTEXTURE9 source_texture, u32 So
int readStride = (expandedWidth * cacheBytes) / TexDecoder_GetBlockWidthInTexels(format);
EncodeToRamUsingShader(texconv_shader, source_texture, scaledSource, dest_ptr, expandedWidth / samples, expandedHeight, readStride, true, bScaleByHalf > 0);
u64 hash = GetHash64(dest_ptr,size_in_bytes,g_ActiveConfig.iSafeTextureCache_ColorSamples);
u64 hash = 0;
if (g_ActiveConfig.bEFBCopyCacheEnable)
{
hash = GetHash64(dest_ptr,size_in_bytes,g_ActiveConfig.iSafeTextureCache_ColorSamples);
// If the texture in RAM is already in the texture cache, do not copy it again as it has not changed.
if (TextureCache::Find(address, hash))
return hash;
// If the texture in RAM is already in the texture cache, do not copy it again as it has not changed.
if (TextureCache::Find(address, hash))
return hash;
}
TextureCache::MakeRangeDynamic(address,size_in_bytes);
return hash;