glsl: Fix assertion checking types of constant bitshift expressions.

Bitshifts are one of the rare places that GLSL allows mixed base types
without an implicit conversion occurring.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Eric Anholt
2011-09-27 14:27:58 -07:00
parent 1d59de1456
commit 344f94bb00

View File

@@ -69,7 +69,9 @@ ir_expression::constant_expression_value()
}
if (op[1] != NULL)
assert(op[0]->type->base_type == op[1]->type->base_type);
assert(op[0]->type->base_type == op[1]->type->base_type ||
this->operation == ir_binop_lshift ||
this->operation == ir_binop_rshift);
bool op0_scalar = op[0]->type->is_scalar();
bool op1_scalar = op[1] != NULL && op[1]->type->is_scalar();