summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-07-08 17:34:53 -0700
committerIan Romanick <[email protected]>2016-08-17 10:52:39 +0100
commit437e612bd7c0aadebf3d1dc959de090266ebab67 (patch)
treeba5a89e966946e84ab2d17b2189f8f57a3712807 /src/compiler/glsl/ir_validate.cpp
parentcceb50e14ed653518c67f84f4d86886a7a237025 (diff)
glsl: Don't support ir_unop_abs or ir_unop_sign for unsigned integers
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_validate.cpp')
-rw-r--r--src/compiler/glsl/ir_validate.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/ir_validate.cpp b/src/compiler/glsl/ir_validate.cpp
index bade45a62ab..3ded2029906 100644
--- a/src/compiler/glsl/ir_validate.cpp
+++ b/src/compiler/glsl/ir_validate.cpp
@@ -246,8 +246,17 @@ ir_validate::visit_leave(ir_expression *ir)
break;
case ir_unop_neg:
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_unop_abs:
case ir_unop_sign:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT ||
+ ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
+ ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_unop_rcp:
case ir_unop_rsq:
case ir_unop_sqrt: