Conor McCarthy (@cmccarthy) commented about libs/vkd3d/cache.c:
vkd3d_free(cache);
}
+/* As the name implies this is taken from moltenvk. */ +#define MVKHASH_SEED 5381 +static inline uint64_t mvkHash64(const uint64_t *pVals, size_t count, uint64_t seed)
An ideal 64-bit hash has a 50% collision probability on about 5 billion entries. I think we should aim for a collision to never occur once, and 64 bits is not enough. Ideally a memcmp() of the entire key would be done in the comparison function after a hash match is found.
I'm not sure of the performance of the moltenvk hash, but a simple prime multiplication hash like [FNV-1a](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function) probably has fewer collisions.