Преглед на файлове

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>
tags/19.1-branchpoint
Timur Kristóf преди 6 години
родител
ревизия
28be7b33b9
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1
    1
      src/gallium/auxiliary/nir/tgsi_to_nir.c

+ 1
- 1
src/gallium/auxiliary/nir/tgsi_to_nir.c Целия файл

@@ -906,7 +906,7 @@ ttn_umad(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)
static void
ttn_arr(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)
{
ttn_move_dest(b, dest, nir_ffloor(b, nir_fadd(b, src[0], nir_imm_float(b, 0.5))));
ttn_move_dest(b, dest, nir_f2i32(b, nir_fround_even(b, src[0])));
}

static void

Loading…
Отказ
Запис