diff options
| author | NeoBrainX <NeoBrainX@gmail.com> | 2011-12-30 01:00:34 +0100 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2012-01-31 19:51:32 +0100 |
| commit | cc54ee7d946da000b635beae03d998543a02d71d (patch) | |
| tree | 9dcc82e8dfc22105ffae6e2e48ea816af185a7ec /Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp | |
| parent | a02df43e6d6b3950561c8df85851e5f24284c0fb (diff) | |
TextureCache: Move EFB copy cache code from TextureConverter to TextureCache
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp')
| -rw-r--r-- | Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp index cc50cdc753..a1a7691907 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp @@ -39,6 +39,7 @@ #include "Globals.h" #include "Hash.h" #include "HiresTextures.h" +#include "HW/Memmap.h" #include "ImageWrite.h" #include "MemoryUtil.h" #include "PixelShaderCache.h" @@ -317,7 +318,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo if (false == g_ActiveConfig.bCopyEFBToTexture) { - hash = TextureConverter::EncodeToRamFromTexture( + int encoded_size = TextureConverter::EncodeToRamFromTexture( addr, read_texture, srcFormat == PIXELFMT_Z24, @@ -325,6 +326,15 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo dstFormat, scaleByHalf, srcRect); + + u8* dst = Memory::GetPointer(addr); + hash = GetHash64(dst,encoded_size,g_ActiveConfig.iSafeTextureCache_ColorSamples); + + // Mark texture entries in destination address range dynamic unless caching is enabled and the texture entry is up to date + if (!g_ActiveConfig.bEFBCopyCacheEnable) + TextureCache::MakeRangeDynamic(addr,encoded_size); + else if (!TextureCache::Find(addr, hash)) + TextureCache::MakeRangeDynamic(addr,encoded_size); } FramebufferManager::SetFramebuffer(0); |
