[Mesa-dev] [PATCH 01/14] glsl: Add ir_unop_saturate
Abdiel Janulgue
abdiel.janulgue at linux.intel.com
Mon Jun 23 22:27:13 PDT 2014
Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
src/glsl/ir.cpp | 2 ++
src/glsl/ir.h | 1 +
src/glsl/ir_validate.cpp | 1 +
3 files changed, 4 insertions(+)
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 8fed768..7682e1e 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -251,6 +251,7 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
case ir_unop_dFdx:
case ir_unop_dFdy:
case ir_unop_bitfield_reverse:
+ case ir_unop_saturate:
this->type = op0->type;
break;
@@ -524,6 +525,7 @@ static const char *const operator_strs[] = {
"bit_count",
"find_msb",
"find_lsb",
+ "sat",
"noise",
"+",
"-",
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index b4e52d3..e70bbd1 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1226,6 +1226,7 @@ enum ir_expression_operation {
ir_unop_find_lsb,
/*@}*/
+ ir_unop_saturate,
ir_unop_noise,
/**
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 17a74ea..ec30ed5 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -243,6 +243,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;
--
1.9.1
More information about the mesa-dev
mailing list