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:
|
case ReplacedTextureHash::QUICK:
|
||||||
return StableQuickTexHash(checkp, sizeInRAM);
|
return StableQuickTexHash(checkp, sizeInRAM);
|
||||||
case ReplacedTextureHash::XXH32:
|
case ReplacedTextureHash::XXH32:
|
||||||
return DoReliableHash32(checkp, sizeInRAM, 0xBACD7814);
|
return XXH32(checkp, sizeInRAM, 0xBACD7814);
|
||||||
case ReplacedTextureHash::XXH64:
|
case ReplacedTextureHash::XXH64:
|
||||||
return DoReliableHash64(checkp, sizeInRAM, 0xBACD7814);
|
return XXH64(checkp, sizeInRAM, 0xBACD7814);
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, GETextureForm
|
||||||
|
|
||||||
case ReplacedTextureHash::XXH32:
|
case ReplacedTextureHash::XXH32:
|
||||||
for (int y = 0; y < h; ++y) {
|
for (int y = 0; y < h; ++y) {
|
||||||
u32 rowHash = DoReliableHash32(checkp, bytesPerLine, 0xBACD7814);
|
u32 rowHash = XXH32(checkp, bytesPerLine, 0xBACD7814);
|
||||||
result = (result * 11) ^ rowHash;
|
result = (result * 11) ^ rowHash;
|
||||||
checkp += stride;
|
checkp += stride;
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ u32 TextureReplacer::ComputeHash(u32 addr, int bufw, int w, int h, GETextureForm
|
||||||
|
|
||||||
case ReplacedTextureHash::XXH64:
|
case ReplacedTextureHash::XXH64:
|
||||||
for (int y = 0; y < h; ++y) {
|
for (int y = 0; y < h; ++y) {
|
||||||
u32 rowHash = DoReliableHash64(checkp, bytesPerLine, 0xBACD7814);
|
u32 rowHash = XXH64(checkp, bytesPerLine, 0xBACD7814);
|
||||||
result = (result * 11) ^ rowHash;
|
result = (result * 11) ^ rowHash;
|
||||||
checkp += stride;
|
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);
|
void DoUnswizzleTex16Basic(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch);
|
||||||
#define DoUnswizzleTex16 DoUnswizzleTex16Basic
|
#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.
|
// For ARM64, NEON is mandatory, so we also statically link.
|
||||||
#elif PPSSPP_ARCH(ARM64) || defined(ARM64)
|
#elif PPSSPP_ARCH(ARM64) || defined(ARM64)
|
||||||
#define DoQuickTexHash QuickTexHashNEON
|
#define DoQuickTexHash QuickTexHashNEON
|
||||||
#define StableQuickTexHash QuickTexHashNEON
|
#define StableQuickTexHash QuickTexHashNEON
|
||||||
#define DoUnswizzleTex16 DoUnswizzleTex16NEON
|
#define DoUnswizzleTex16 DoUnswizzleTex16NEON
|
||||||
|
|
||||||
#include "ext/xxhash.h"
|
|
||||||
#define DoReliableHash32 XXH32
|
|
||||||
#define DoReliableHash64 XXH64
|
|
||||||
|
|
||||||
#define DoReliableHash XXH64
|
|
||||||
typedef u64 ReliableHashType;
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
typedef u32 (*QuickTexHashFunc)(const void *checkp, u32 size);
|
typedef u32 (*QuickTexHashFunc)(const void *checkp, u32 size);
|
||||||
extern QuickTexHashFunc DoQuickTexHash;
|
extern QuickTexHashFunc DoQuickTexHash;
|
||||||
|
@ -77,13 +57,6 @@ extern QuickTexHashFunc StableQuickTexHash;
|
||||||
|
|
||||||
typedef void (*UnswizzleTex16Func)(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch);
|
typedef void (*UnswizzleTex16Func)(const u8 *texptr, u32 *ydestp, int bxc, int byc, u32 pitch);
|
||||||
extern UnswizzleTex16Func DoUnswizzleTex16;
|
extern UnswizzleTex16Func DoUnswizzleTex16;
|
||||||
|
|
||||||
#include "ext/xxhash.h"
|
|
||||||
#define DoReliableHash32 XXH32
|
|
||||||
#define DoReliableHash64 XXH64
|
|
||||||
|
|
||||||
#define DoReliableHash XXH32
|
|
||||||
typedef u32 ReliableHashType;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CheckAlphaResult CheckAlphaRGBA8888Basic(const u32 *pixelData, int stride, int w, int h);
|
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_);
|
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||||
|
|
||||||
if (replacer_.Enabled())
|
if (replacer_.Enabled())
|
||||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||||
else
|
else
|
||||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||||
clutBuf_ = clutBufRaw_;
|
clutBuf_ = clutBufRaw_;
|
||||||
|
|
|
@ -251,7 +251,7 @@ void TextureCacheDX9::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase
|
||||||
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||||
|
|
||||||
if (replacer_.Enabled())
|
if (replacer_.Enabled())
|
||||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||||
else
|
else
|
||||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||||
clutBuf_ = clutBufRaw_;
|
clutBuf_ = clutBufRaw_;
|
||||||
|
|
|
@ -250,7 +250,7 @@ void TextureCacheGLES::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBas
|
||||||
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||||
|
|
||||||
if (replacer_.Enabled())
|
if (replacer_.Enabled())
|
||||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||||
else
|
else
|
||||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
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_);
|
const u32 clutExtendedBytes = std::min(clutTotalBytes_ + clutBaseBytes, clutMaxBytes_);
|
||||||
|
|
||||||
if (replacer_.Enabled())
|
if (replacer_.Enabled())
|
||||||
clutHash_ = DoReliableHash32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
clutHash_ = XXH32((const char *)clutBufRaw_, clutExtendedBytes, 0xC0108888);
|
||||||
else
|
else
|
||||||
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
clutHash_ = XXH3_64bits((const char *)clutBufRaw_, clutExtendedBytes) & 0xFFFFFFFF;
|
||||||
clutBuf_ = clutBufRaw_;
|
clutBuf_ = clutBufRaw_;
|
||||||
|
|
Loading…
Add table
Reference in a new issue