Change the recent speedup to the hashing function to fall back to the old version for custom textures.

Re-fixed custom textures higher than 1024x1024. (It must have accidentally got reverted somewhere during the video plugin merge)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7064 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
baby.lueshi 2011-02-04 22:51:17 +00:00
parent f7d757b46e
commit cd9e6a8d23
3 changed files with 15 additions and 9 deletions

View file

@ -133,18 +133,23 @@ u64 GetCRC32(const u8 *src, int len, u32 samples)
#endif
}
u64 GetHash64(const u8 *src, int len, u32 samples)
u64 GetHash64(const u8 *src, int len, u32 samples, bool legacy)
{
const u64 m = 0xc6a4a7935bd1e995;
u64 h = len * m;
#if _M_SSE >= 0x402
if (cpu_info.bSSE4_2)
if (cpu_info.bSSE4_2 && !legacy)
{
h = GetCRC32(src, len, samples);
}
else
#endif
/* NOTE: This hash function is used for custom texture loading/dumping, so
it should not be changed, which would require all custom textures to be
recalculated for their new hash values. If the hashing function is
changed, make sure this one is still used when the legacy parameter is
true. */
{
const int r = 47;
u32 Step = (len / 8);