Mesa (master): vc4: Use the fnv1 hash function instead of gallium util' s crc32.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 10 13:55:18 UTC 2014


Module: Mesa
Branch: master
Commit: 070b2c2efc415f459e9c32415b401609acded565
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=070b2c2efc415f459e9c32415b401609acded565

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Oct 10 13:56:45 2014 +0200

vc4: Use the fnv1 hash function instead of gallium util's crc32.

Improves simulated norast performance on a little benchmark by 13.4012%
+/- 2.08459% (n=13).

---

 src/gallium/drivers/vc4/vc4_program.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index b22426c..690f644 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -31,6 +31,7 @@
 #include "util/u_pack_color.h"
 #include "util/format_srgb.h"
 #include "util/ralloc.h"
+#include "util/hash_table.h"
 #include "tgsi/tgsi_dump.h"
 #include "tgsi/tgsi_info.h"
 #include "tgsi/tgsi_lowering.h"
@@ -1886,13 +1887,13 @@ vc4_update_compiled_shaders(struct vc4_context *vc4, uint8_t prim_mode)
 static unsigned
 fs_cache_hash(void *key)
 {
-        return util_hash_crc32(key, sizeof(struct vc4_fs_key));
+        return _mesa_hash_data(key, sizeof(struct vc4_fs_key));
 }
 
 static unsigned
 vs_cache_hash(void *key)
 {
-        return util_hash_crc32(key, sizeof(struct vc4_vs_key));
+        return _mesa_hash_data(key, sizeof(struct vc4_vs_key));
 }
 
 static int




More information about the mesa-commit mailing list