mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-11 17:18:37 +00:00
Vertexcache ComputeMiniHashRange: Doesn't make sense to hash more data than the step size.
This commit is contained in:
parent
47a814c80d
commit
0bbb61e5d2
@ -444,9 +444,10 @@ inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) {
|
|||||||
|
|
||||||
if (sz > 100) {
|
if (sz > 100) {
|
||||||
size_t step = sz / 4;
|
size_t step = sz / 4;
|
||||||
|
size_t len = std::min((int)step, 100);
|
||||||
u32 hash = 0;
|
u32 hash = 0;
|
||||||
for (size_t i = 0; i < sz; i += step) {
|
for (size_t i = 0; i < sz; i += step) {
|
||||||
hash += DoReliableHash32(p + i, 100, 0x3A44B9C4);
|
hash += DoReliableHash32(p + i, len, 0x3A44B9C4);
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
} else {
|
} else {
|
||||||
|
@ -428,9 +428,10 @@ inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) {
|
|||||||
|
|
||||||
if (sz > 100) {
|
if (sz > 100) {
|
||||||
size_t step = sz / 4;
|
size_t step = sz / 4;
|
||||||
|
size_t len = std::min((int)step, 100);
|
||||||
u32 hash = 0;
|
u32 hash = 0;
|
||||||
for (size_t i = 0; i < sz; i += step) {
|
for (size_t i = 0; i < sz; i += step) {
|
||||||
hash += DoReliableHash32(p + i, 100, 0x3A44B9C4);
|
hash += DoReliableHash32(p + i, len, 0x3A44B9C4);
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
} else {
|
} else {
|
||||||
|
@ -445,8 +445,9 @@ inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) {
|
|||||||
if (sz > 100) {
|
if (sz > 100) {
|
||||||
size_t step = sz / 4;
|
size_t step = sz / 4;
|
||||||
u32 hash = 0;
|
u32 hash = 0;
|
||||||
|
size_t len = std::min((int)step, 100);
|
||||||
for (size_t i = 0; i < sz; i += step) {
|
for (size_t i = 0; i < sz; i += step) {
|
||||||
hash += DoReliableHash32(p + i, 100, 0x3A44B9C4);
|
hash += DoReliableHash32(p + i, len, 0x3A44B9C4);
|
||||||
}
|
}
|
||||||
return hash;
|
return hash;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user