diff options
author | Eric Anholt <[email protected]> | 2020-05-29 15:23:51 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-07-03 23:27:06 +0000 |
commit | b9e163fa67ea27fffd3d2294f4f1e19b57814aeb (patch) | |
tree | 89acc8a936b63a536a9091b02620b6187c90cd63 /src/mesa/drivers/dri/nouveau/nv20_state_frag.c | |
parent | 29ce8060eb0584d619e48c440540adc1f32de76e (diff) |
util: Avoid strict aliasing bugs in xxhash.
XXH32 is doing access through u32 *, and with strict aliasing the compiler
gets to assume that those are independent of the u16 writes we did in
fd6_texture_key setup, and based on various tweaks to the code, would
result in bad hashes computed after inlining. The failure was:
../src/util/hash_table.c:326:_mesa_hash_table_search_pre_hashed: Assertion
`ht->key_hash_function == ((void *)0) || hash == ht->key_hash_function(key)'
failed.)
By setting these two flags, we always take the unaligned,
memcpy-the-32-bit-data path. I believe this should be same perf on x86
(which will happily unaligned load 32 bits in the end), while it will be
slower on arm (where you have to a special unaligned load operation iirc).
This should still be far faster than our old hash.
Fixes: edd62619a1c4 ("freedreno: replace fnv1a hash function with xxhash")
Acked-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5271>
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv20_state_frag.c')
0 files changed, 0 insertions, 0 deletions