CustomTexture: Use always safe texture hash

This commit is contained in:
degasus 2015-01-14 20:25:40 +01:00
parent eeaad06a07
commit a353ead3cb
2 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ u32 HashAdler32(const u8* data, size_t len); // Fairly accurate, slightl
u32 HashFNV(const u8* ptr, int length); // Another fast and decent hash
u32 HashEctor(const u8* ptr, int length); // JUNK. DO NOT USE FOR NEW THINGS
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 = 0);
u64 GetMurmurHash3(const u8 *src, int len, u32 samples);
u64 GetHash64(const u8 *src, int len, u32 samples);
void SetHash64Function();

View file

@ -118,12 +118,12 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co
tlut += 2 * min;
}
u64 tex_hash = GetHashHiresTexture(texture, (int)texture_size, g_ActiveConfig.iSafeTextureCache_ColorSamples);
u64 tex_hash = GetHashHiresTexture(texture, (int)texture_size);
u64 tlut_hash = 0;
u64 hash = tex_hash;
if (tlut_size)
{
tlut_hash = GetHashHiresTexture(tlut, (int)tlut_size, g_ActiveConfig.iSafeTextureCache_ColorSamples);
tlut_hash = GetHashHiresTexture(tlut, (int)tlut_size);
hash ^= tlut_hash;
}
return StringFromFormat("%s_%08x_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32)hash, (u16)format);