From 2b0e2f0729b4c6b136e6023ff8026479000ed589 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 19 Jan 2021 12:13:11 +0100 Subject: [PATCH] gallium/cso: use a different hash function Signed-off-by: Gert Wollny Reviewed-by: Chia-I Wu --- src/gallium/auxiliary/cso_cache/cso_cache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.c b/src/gallium/auxiliary/cso_cache/cso_cache.c index 232fa9e..0bd124e 100644 --- a/src/gallium/auxiliary/cso_cache/cso_cache.c +++ b/src/gallium/auxiliary/cso_cache/cso_cache.c @@ -54,8 +54,10 @@ static unsigned hash_key(const void *key, unsigned key_size) /* I'm sure this can be improved on: */ - for (i = 0; i < key_size/4; i++) + for (i = 0; i < key_size/4; i++) { + hash = (hash << 7) | (hash >> 25); hash ^= ikey[i]; + } return hash; }