tgsi_to_nir: Fix TGSI LIT translation by using flt.

TGSI spec says LIT needs a "greater than" comparison. NIR doesn't have that,
so let's use "less than" and swap the arguments. Previously "greater than or equal"
was used by tgsi_to_nir which is incorrect.

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: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Timur Kristóf
2019-02-14 00:45:47 +02:00
committed by Eric Anholt
parent 28be7b33b9
commit fa076acbc0

View File

@@ -858,9 +858,9 @@ ttn_lit(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)
ttn_move_dest_masked(b, dest,
nir_bcsel(b,
nir_fge(b,
nir_imm_float(b, 0.0),
ttn_channel(b, src[0], X)),
nir_flt(b,
ttn_channel(b, src[0], X),
nir_imm_float(b, 0.0)),
nir_imm_float(b, 0.0),
pow),
TGSI_WRITEMASK_Z);