i965/fs: Add support for ir_unop_saturate
authorAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
Mon, 16 Jun 2014 17:35:44 +0000 (10:35 -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>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index d98b7ebc64522e72ac7ccfc87289f3ce24df06b7..cb0a07948c0209a5556912853c8ac72844a83674 100644 (file)
@@ -246,6 +246,7 @@ ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
    case ir_unop_bit_count:
    case ir_unop_find_msb:
    case ir_unop_find_lsb:
+   case ir_unop_saturate:
       for (i = 0; i < vector_elements; i++) {
         ir_rvalue *op0 = get_element(op_var[0], i);
 
index c05558053266224d8dbfcb77ca638ee056051053..7ceca0eb304c38f796c70e5e6c03878bdd2aa089 100644 (file)
@@ -864,6 +864,10 @@ fs_visitor::visit(ir_expression *ir)
    case ir_unop_find_lsb:
       emit(FBL(this->result, op[0]));
       break;
+   case ir_unop_saturate:
+      inst = emit(MOV(this->result, op[0]));
+      inst->saturate = true;
+      break;
    case ir_triop_bitfield_extract:
       /* Note that the instruction's argument order is reversed from GLSL
        * and the IR.