Vertex cache minihash: Round up the starting address to a multiple of 4.

This commit is contained in:
Henrik Rydgård committed 2021-01-30 18:40:18 +01:00
1 parent 1eeebccd04
commit 9a24bcdd9f
1 file changed
+3 -2
+3 -2
View File
@@ -599,8 +599,9 @@ void DrawEngineCommon::DecodeVertsStep(u8 *dest, int &i, int &decodedVerts) {
}
inline u32 ComputeMiniHashRange(const void *ptr, size_t sz) {
// Switch to u32 units.
const u32 *p = (const u32 *)ptr;
// Switch to u32 units, and round up to avoid unaligned accesses.
// Probably doesn't matter if we skip the first few bytes in some cases.
const u32 *p = (const u32 *)(((uintptr_t)ptr + 3) & ~3);
sz >>= 2;
if (sz > 100) {