mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 16:59:18 +01:00
CustomTexture: Use always safe texture hash
This commit is contained in:
parent
eeaad06a07
commit
a353ead3cb
@ -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 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
|
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 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 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();
|
void SetHash64Function();
|
||||||
|
@ -118,12 +118,12 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co
|
|||||||
tlut += 2 * min;
|
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 tlut_hash = 0;
|
||||||
u64 hash = tex_hash;
|
u64 hash = tex_hash;
|
||||||
if (tlut_size)
|
if (tlut_size)
|
||||||
{
|
{
|
||||||
tlut_hash = GetHashHiresTexture(tlut, (int)tlut_size, g_ActiveConfig.iSafeTextureCache_ColorSamples);
|
tlut_hash = GetHashHiresTexture(tlut, (int)tlut_size);
|
||||||
hash ^= tlut_hash;
|
hash ^= tlut_hash;
|
||||||
}
|
}
|
||||||
return StringFromFormat("%s_%08x_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32)hash, (u16)format);
|
return StringFromFormat("%s_%08x_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32)hash, (u16)format);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user