radv: use util_float_to_half_rtz
authorChristopher Egert <cme3000@gmail.com>
Fri, 15 May 2020 14:41:15 +0000 (16:41 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 16 May 2020 23:12:59 +0000 (01:12 +0200)
commit78615dcca19699737bf9cbc784b66d9ea966bcc0
tree817ce9cf275a904788cb70d0241e85982f43f4ac
parent632a921bd0dd40ad3167a0b8a74fe7054a78256a
radv: use util_float_to_half_rtz

Since commit 8b8af6d398a94cb07015c695fdfdb5c157aa72cf there is a
performance regression in dirt 4 on picasso APUs.

The game ends up feeding a large value into this which overflows on the
conversion to 16bit float. With the old implementation (which now lives
in util_float_to_half_rtz) it would be clamped to inf-1, while the new
one returns inf. This causes a performance hit somehow at some point
down the line.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fixes: 8b8af6d398a "gallium/util: Switch util_float_to_half to _mesa_float_to_half()'s impl."
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5062>
src/amd/vulkan/radv_formats.c