dxil: Use nir_const_value_for_uint in dxil_nir_lower_int_samplers
authorJason Ekstrand <jason.ekstrand@collabora.com>
Fri, 11 Nov 2022 21:14:16 +0000 (15:14 -0600)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Dec 2022 23:12:30 +0000 (23:12 +0000)
commitcd5c66e165374026d62692bcbf69a7157e460f91
tree5955c73dd1a22684c75116923e09b2eb4d8c112e
parentf3f1c28f8e6d40823e3d12415a8d0ea622f9fa20
dxil: Use nir_const_value_for_uint in dxil_nir_lower_int_samplers

This change should avoid any accidental rounding issues because of
border colors getting stored in a float in dxil_wrap_sampler_state.  It
also switches us to using the correct helpers for nir_const_value so we
can avoid any weird uninitialized data failures that can be caused by
filling out the fields in the struct directly.

Fixes: b9c61379ab4c ("microsoft/compiler: translate nir to dxil")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
src/microsoft/compiler/dxil_nir_lower_int_samplers.c