TextureCache: Move EFB copy cache code from TextureConverter to TextureCache

This commit is contained in:
NeoBrainX
2011-12-30 01:00:34 +01:00
committed by NeoBrainX
parent a02df43e6d
commit cc54ee7d94
7 changed files with 51 additions and 51 deletions

View File

@ -21,6 +21,7 @@
#include "Statistics.h"
#include "MemoryUtil.h"
#include "Hash.h"
#include "HW/Memmap.h"
#include "CommonPaths.h"
#include "FileUtil.h"
@ -143,16 +144,25 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
if (!g_ActiveConfig.bCopyEFBToTexture)
{
hash = TextureConverter::EncodeToRamFromTexture(
addr,
read_texture,
Renderer::GetTargetWidth(),
Renderer::GetTargetHeight(),
srcFormat == PIXELFMT_Z24,
isIntensity,
dstFormat,
scaleByHalf,
srcRect);
int encoded_size = TextureConverter::EncodeToRamFromTexture(
addr,
read_texture,
Renderer::GetTargetWidth(),
Renderer::GetTargetHeight(),
srcFormat == PIXELFMT_Z24,
isIntensity,
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);
}
D3D::RefreshSamplerState(0, D3DSAMP_MINFILTER);