summaryrefslogtreecommitdiff
path: root/src/glsl/ir_validate.cpp
diff options
context:
space:
mode:
authorChad Versace <chad@chad-versace.us>2010-10-08 16:22:28 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-10-15 00:20:18 -0700
commit5c4c36f7f3842e287b303b1eca8d260c37e3580b (patch)
treefa751843d4b4e4ba08481fb8643baf46b1cfafdc /src/glsl/ir_validate.cpp
parentf88b4eaa8f6659fd1dab72697b8e80e157bee17f (diff)
glsl: Implement ast-to-hir for binary shifts in GLSL 1.30
Implement by adding the following cases to ast_expression::hir(): - ast_lshift - ast_rshift Also, implement ir validation for the new operators by adding the following cases to ir_validate::visit_leave(): - ir_binop_lshift - ir_binop_rshift
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r--src/glsl/ir_validate.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp
index 70fb939b10..db1ffb2de3 100644
--- a/src/glsl/ir_validate.cpp
+++ b/src/glsl/ir_validate.cpp
@@ -331,6 +331,19 @@ ir_validate::visit_leave(ir_expression *ir)
case ir_binop_lshift:
case ir_binop_rshift:
+ assert(ir->operands[0]->type->is_integer() &&
+ ir->operands[1]->type->is_integer());
+ if (ir->operands[0]->type->is_scalar()) {
+ assert(ir->operands[1]->type->is_scalar());
+ }
+ if (ir->operands[0]->type->is_vector() &&
+ ir->operands[1]->type->is_vector()) {
+ assert(ir->operands[0]->type->components() ==
+ ir->operands[1]->type->components());
+ }
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_binop_bit_and:
case ir_binop_bit_xor:
case ir_binop_bit_or: