浏览代码

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

正在加载...
取消
保存