summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2013-01-15 12:16:12 -0800
committerChad Versace <[email protected]>2013-01-24 21:24:10 -0800
commit9d7931ddf06bd41f1b1a589503cd028ff00d134e (patch)
tree65137ed6d4ae27580d85c40e187292533cfb4897 /src/glsl/ir.cpp
parentccf87f2199819a9e78713e416a34b886194a2f51 (diff)
glsl: Fix type-deduction for and/or/xor expressions
In ir_expression's constructor, the cases for {bit,logic}_{and,or,xor} failed to handle the case when both operands were vectors. Note: This is a candidate for the stable branches. Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index bb02df37bf1..49ee2fe9ef4 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -378,10 +378,15 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
case ir_binop_bit_and:
case ir_binop_bit_xor:
case ir_binop_bit_or:
+ assert(!op0->type->is_matrix());
+ assert(!op1->type->is_matrix());
if (op0->type->is_scalar()) {
this->type = op1->type;
} else if (op1->type->is_scalar()) {
this->type = op0->type;
+ } else {
+ assert(op0->type->vector_elements == op1->type->vector_elements);
+ this->type = op0->type;
}
break;