[Mesa-dev] [PATCH 109/133] nir/glsl: Emit abs, neg, and sat operations instead of source modifiers
Jason Ekstrand
jason at jlekstrand.net
Mon Dec 15 22:12:52 PST 2014
---
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 7654972..5ead8cd 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -1041,19 +1041,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.2.0
More information about the mesa-dev
mailing list