diff options
author | Jason Ekstrand <[email protected]> | 2014-11-13 17:23:58 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:20:20 -0800 |
commit | a94d1c248153a50923d8639123f956ec1961a837 (patch) | |
tree | a5d8e8ee6d8cd009ae62e2cab759492058eae22a /src | |
parent | 8edcd1de143816d4e1268dc7617ec23a067db970 (diff) |
nir/glsl: Emit abs, neg, and sat operations instead of source modifiers
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/nir/glsl_to_nir.cpp | 9 |
1 files 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, |