mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GPU: Remove ReliableHash aliases.
Let's just use XXH32/XXH64 directly in texture replacements, clearer anyway.
This commit is contained in:
parent
7f812a5d9a
commit
e32524c544
6 changed files with 8 additions and 35 deletions
|
@ -246,9 +246,9 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, GETextureForm
|
|||
case ReplacedTextureHash::QUICK:
|
||||
return StableQuickTexHash(checkp, sizeInRAM);
|
||||
case ReplacedTextureHash::XXH32:
|
||||
return DoReliableHash32(checkp, sizeInRAM, 0xBACD7814);
|
||||
return XXH32(checkp, sizeInRAM, 0xBACD7814);
|
||||
case ReplacedTextureHash::XXH64:
|
||||
return DoReliableHash64(checkp, sizeInRAM, 0xBACD7814);
|
||||
return XXH64(checkp, sizeInRAM, 0xBACD7814);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, GETextureForm
|
|||
|
||||
case ReplacedTextureHash::XXH32:
|
||||
for (int y = 0; y < h; ++y) {
|
||||
u32 rowHash = DoReliableHash32(checkp, bytesPerLine, 0xBACD7814);
|
||||
u32 rowHash = XXH32(checkp, bytesPerLine, 0xBACD7814);
|
||||
result = (result * 11) ^ rowHash;
|
||||
checkp += stride;
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, GETextureForm
|
|||
|
||||
case ReplacedTextureHash::XXH64:
|
||||
for (int y = 0; y < h; ++y) {
|
||||
u32 rowHash = DoReliableHash64(checkp, bytesPerLine, 0xBACD7814);
|
||||
u32 rowHash = XXH64(checkp, bytesPerLine, 0xBACD7814);
|
||||
result = (result * 11) ^ rowHash;
|
||||
checkp += stride;
|
||||
}
|
||||
|
|
|
@ -45,31 +45,11 @@ u32 QuickTexHashSSE2(const void *checkp, u32 size);
|
|||
void DoUnswizzleTex16Basic(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch);
|
||||
#define DoUnswizzleTex16 DoUnswizzleTex16Basic
|
||||
|
||||
#include "ext/xxhash.h"
|
||||
#define DoReliableHash32 XXH32
|
||||
#define DoReliableHash64 XXH64
|
||||
|
||||
#if defined(_M_X64) || defined(ARM64)
|
||||
#define DoReliableHash XXH64
|
||||
typedef u64 ReliableHashType;
|
||||
#else
|
||||
#define DoReliableHash XXH32
|
||||
typedef u32 ReliableHashType;
|
||||
#endif
|
||||
|
||||
// For ARM64, NEON is mandatory, so we also statically link.
|
||||
#elif PPSSPP_ARCH(ARM64) || defined(ARM64)
|
||||
#define DoQuickTexHash QuickTexHashNEON
|
||||
#define StableQuickTexHash QuickTexHashNEON
|
||||
#define DoUnswizzleTex16 DoUnswizzleTex16NEON
|
||||
|
||||
#include "ext/xxhash.h"
|
||||
#define DoReliableHash32 XXH32
|
||||
#define DoReliableHash64 XXH64
|
||||
|
||||
#define DoReliableHash XXH64
|
||||
typedef u64 ReliableHashType;
|
||||
|
||||
#else
|
||||
typedef u32 (*QuickTexHashFunc)(const void *checkp, u32 size);
|
||||
extern QuickTexHashFunc DoQuickTexHash;
|
||||
|
@ -77,13 +57,6 @@ extern QuickTexHashFunc StableQuickTexHash;
|
|||
|
||||
typedef void (*UnswizzleTex16Func)(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch);
|
||||
extern UnswizzleTex16Func DoUnswizzleTex16;
|
||||
|
||||
#include "ext/xxhash.h"
|
||||
#define DoReliableHash32 XXH32
|
||||
#define DoReliableHash64 XXH64
|
||||
|
||||
#define DoReliableHash XXH32
|
||||
typedef u32 ReliableHashType;
|
||||
#endif
|
||||
|
||||
CheckAlphaResult CheckAlphaRGBA8888Basic(const u32 *pixelData, int stride, int w, int h);
|
||||
|
|
|
@ -209,7 +209,7 @@ void TextureCacheD3D11::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBa
|
|||
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||
|
||||
if (replacer_.Enabled())
|
||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
else
|
||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||
clutBuf_ = clutBufRaw_;
|
||||
|
|
|
@ -251,7 +251,7 @@ void TextureCacheDX9::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase
|
|||
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||
|
||||
if (replacer_.Enabled())
|
||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
else
|
||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||
clutBuf_ = clutBufRaw_;
|
||||
|
|
|
@ -250,7 +250,7 @@ void TextureCacheGLES::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBas
|
|||
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||
|
||||
if (replacer_.Enabled())
|
||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
else
|
||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||
|
||||
|
|
|
@ -508,7 +508,7 @@ void TextureCacheVulkan::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutB
|
|||
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||
|
||||
if (replacer_.Enabled())
|
||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||
else
|
||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||
clutBuf_ = clutBufRaw_;
|
||||
|
|
Loading…
Add table
Reference in a new issue