translate: improve sse2 32-bit unsigned -> float conversion
authorIlia Mirkin <imirkin@alum.mit.edu>
Tue, 8 Feb 2022 04:40:25 +0000 (23:40 -0500)
committerMarge Bot <emma+marge@anholt.net>
Wed, 9 Feb 2022 06:04:25 +0000 (06:04 +0000)
commit5200e1c2120f3143dcd11eb0bc0b4ddf8ee62f86
treeb693bea059407b5db70e69ee71cbdf156038bf37
parent0b69f7b15d526fc763f1dd4aafbc358449aa9ac6
translate: improve sse2 32-bit unsigned -> float conversion

The existing logic would drop the low bit. Instead, let's drop the high
bit, do the conversion, and then add the fixed constant back in if the
value had the high bit set originally.

Fixes KHR-GL45.direct_state_access.vertex_arrays_attribute_format on
drivers that use this module to handle the format conversion.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Emma Anholt <emma@anholt.net>
Tested-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14922>
src/gallium/auxiliary/translate/translate_sse.c
src/gallium/drivers/zink/ci/zink-lvp-fails.txt