ir_to_mesa, glsl_to_tgsi: Add support for ir_unop_saturate
authorAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
Mon, 16 Jun 2014 18:14:32 +0000 (11:14 -0700)
committerAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
Sun, 31 Aug 2014 18:04:08 +0000 (21:04 +0300)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
src/mesa/program/ir_to_mesa.cpp
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index ff3d0d6717e52f7d14cb489210f159b718c1d3f8..c6aae1a7033489399a8741e71398229a73f7c529 100644 (file)
@@ -1171,6 +1171,12 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
       emit(ir, OPCODE_DDY, result_dst, op[0]);
       break;
 
+   case ir_unop_saturate: {
+      ir_to_mesa_instruction *inst = emit(ir, OPCODE_MOV,
+                                          result_dst, op[0]);
+      inst->saturate = true;
+      break;
+   }
    case ir_unop_noise: {
       const enum prog_opcode opcode =
         prog_opcode(OPCODE_NOISE1
index 575da1eaf8f7653f9dc7ce6a61cbb89a7b1eaf64..55b994008d1f67d366381284029e54242b87adb7 100644 (file)
@@ -1460,6 +1460,12 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
    case ir_unop_cos_reduced:
       emit_scs(ir, TGSI_OPCODE_COS, result_dst, op[0]);
       break;
+   case ir_unop_saturate: {
+      glsl_to_tgsi_instruction *inst;
+      inst = emit(ir, TGSI_OPCODE_MOV, result_dst, op[0]);
+      inst->saturate = true;
+      break;
+   }
 
    case ir_unop_dFdx:
    case ir_unop_dFdx_coarse: