From a2c1527acda67578b542488e14d46ec1a44756fb Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Thu, 20 Jan 2022 13:26:01 +0100 Subject: [PATCH] vkd3d-shader: Reuse hashmap.h hasher for shader hash. Signed-off-by: Hans-Kristian Arntzen --- libs/vkd3d-shader/vkd3d_shader_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 317d1329..485137be 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -712,12 +712,12 @@ void vkd3d_shader_free_shader_signature(struct vkd3d_shader_signature *signature vkd3d_shader_hash_t vkd3d_shader_hash(const struct vkd3d_shader_code *shader) { - vkd3d_shader_hash_t h = 0xcbf29ce484222325ull; + vkd3d_shader_hash_t h = hash_fnv1_init(); const uint8_t *code = shader->code; size_t i, n; for (i = 0, n = shader->size; i < n; i++) - h = (h * 0x100000001b3ull) ^ code[i]; + h = hash_fnv1_iterate_u8(h, code[i]); return h; }