From a94d1c248153a50923d8639123f956ec1961a837 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 13 Nov 2014 17:23:58 -0800 Subject: [PATCH] nir/glsl: Emit abs, neg, and sat operations instead of source modifiers Reviewed-by: Connor Abbott --- src/glsl/nir/glsl_to_nir.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index 5d0d0bc8f51..c90425b1300 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -1036,19 +1036,16 @@ nir_visitor::visit(ir_expression *ir) emit(supports_ints ? nir_op_inot : nir_op_fnot, dest_size, srcs); break; case ir_unop_neg: - instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fmov : nir_op_imov, + instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fneg : nir_op_ineg, dest_size, srcs); - instr->src[0].negate = true; break; case ir_unop_abs: - instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fmov : nir_op_imov, + instr = emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fabs : nir_op_iabs, dest_size, srcs); - instr->src[0].abs = true; break; case ir_unop_saturate: assert(types[0] == GLSL_TYPE_FLOAT); - instr = emit(nir_op_fmov, dest_size, srcs); - instr->dest.saturate = true; + instr = emit(nir_op_fsat, dest_size, srcs); break; case ir_unop_sign: emit(types[0] == GLSL_TYPE_FLOAT ? nir_op_fsign : nir_op_isign, -- 2.30.2