VideoCommon: make hash independet from hires textures

This commit is contained in:
degasus 2014-12-22 22:35:08 +01:00
parent f8184858da
commit c6dd5044d6
3 changed files with 5 additions and 10 deletions

View File

@ -510,19 +510,15 @@ u64 GetHash64(const u8 *src, int len, u32 samples)
} }
// sets the hash function used for the texture cache // sets the hash function used for the texture cache
void SetHash64Function(bool useHiresTextures) void SetHash64Function()
{ {
if (useHiresTextures)
{
ptrHashFunction = &GetHashHiresTexture;
}
#if _M_SSE >= 0x402 #if _M_SSE >= 0x402
else if (cpu_info.bSSE4_2 && !useHiresTextures) // sse crc32 version if (cpu_info.bSSE4_2) // sse crc32 version
{ {
ptrHashFunction = &GetCRC32; ptrHashFunction = &GetCRC32;
} }
#endif
else else
#endif
{ {
ptrHashFunction = &GetMurmurHash3; ptrHashFunction = &GetMurmurHash3;
} }

View File

@ -16,4 +16,4 @@ u64 GetCRC32(const u8 *src, int len, u32 samples); // SSE4.2 version of CRC32
u64 GetHashHiresTexture(const u8 *src, int len, u32 samples); u64 GetHashHiresTexture(const u8 *src, int len, u32 samples);
u64 GetMurmurHash3(const u8 *src, int len, u32 samples); u64 GetMurmurHash3(const u8 *src, int len, u32 samples);
u64 GetHash64(const u8 *src, int len, u32 samples); u64 GetHash64(const u8 *src, int len, u32 samples);
void SetHash64Function(bool useHiresTextures); void SetHash64Function();

View File

@ -62,7 +62,7 @@ TextureCache::TextureCache()
if (g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures) if (g_ActiveConfig.bHiresTextures && !g_ActiveConfig.bDumpTextures)
HiresTexture::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID); HiresTexture::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID);
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures); SetHash64Function();
invalidate_texture_cache_requested = false; invalidate_texture_cache_requested = false;
} }
@ -110,7 +110,6 @@ void TextureCache::OnConfigChanged(VideoConfig& config)
if (g_ActiveConfig.bHiresTextures) if (g_ActiveConfig.bHiresTextures)
HiresTexture::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID); HiresTexture::Init(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID);
SetHash64Function(g_ActiveConfig.bHiresTextures || g_ActiveConfig.bDumpTextures);
TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter); TexDecoder_SetTexFmtOverlayOptions(g_ActiveConfig.bTexFmtOverlayEnable, g_ActiveConfig.bTexFmtOverlayCenter);
invalidate_texture_cache_requested = false; invalidate_texture_cache_requested = false;