glsl: Add ir_unop_saturate
authorAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
Fri, 20 Jun 2014 18:56:48 +0000 (11:56 -0700)
committerAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
Sun, 31 Aug 2014 18:04:08 +0000 (21:04 +0300)
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_validate.cpp

index b289c29756d793892ede3b77bb4d848df41952c5..739a9f41257bb941a21db512d63be718aac57e90 100644 (file)
@@ -255,6 +255,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
    case ir_unop_dFdy_fine:
    case ir_unop_bitfield_reverse:
    case ir_unop_interpolate_at_centroid:
+   case ir_unop_saturate:
       this->type = op0->type;
       break;
 
@@ -534,6 +535,7 @@ static const char *const operator_strs[] = {
    "bit_count",
    "find_msb",
    "find_lsb",
+   "sat",
    "noise",
    "interpolate_at_centroid",
    "+",
index e9051732bcc98d753a802b7eb800af2a79ed2b97..8003f88ce3d93e3d84e4de6a8f58ab8f8e15329d 100644 (file)
@@ -1250,6 +1250,7 @@ enum ir_expression_operation {
    ir_unop_find_lsb,
    /*@}*/
 
+   ir_unop_saturate,
    ir_unop_noise,
 
    /**
index 5b20677825ce3caad5fd95807483de7b6afe2341..97a581dc2d5afcb0eef11aa221bdbc1b0d1a8c08 100644 (file)
@@ -241,6 +241,7 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_unop_log:
    case ir_unop_exp2:
    case ir_unop_log2:
+   case ir_unop_saturate:
       assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
       assert(ir->type == ir->operands[0]->type);
       break;