OSDN Git Service

tgsi_to_nir: Fix the TGSI ARR translation by converting the result to int.
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 7 Feb 2019 17:01:24 +0000 (18:01 +0100)
committerEric Anholt <eric@anholt.net>
Tue, 5 Mar 2019 19:13:27 +0000 (19:13 +0000)
commit28be7b33b959da0eccf8a24b72a441471b7df5f7
tree3060ccd7f59722040b4b9faa2a3a0b78dc400715
parent317f10bf404b562e1dda79c0636aee86beeccc2f
tgsi_to_nir: Fix the TGSI ARR translation by converting the result to int.

According to the TGSI spec, ARR needs to do a rounding and then
a float-to-integer conversion which was missing. This patch also
makes the rounding a bit more efficient by using nir_fround_even
instead of the previous nir_ffloor+nir_fadd trick.

Signed-Off-By: Timur Kristóf <timur.kristof@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com>
Tested-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/gallium/auxiliary/nir/tgsi_to_nir.c