glsl: Validate that base types match for a number of binops.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 7 Apr 2014 05:45:43 +0000 (22:45 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 8 Apr 2014 07:02:01 +0000 (00:02 -0700)
The IR is not supposed to support implicit type conversions; we just
failed to validate it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ir_validate.cpp

index 527acea4c3503aa85fdf3280867aa538fdd1dfb1..71defc8159306cdea63cee25e7ea8f33c0c1089a 100644 (file)
@@ -381,6 +381,9 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_binop_min:
    case ir_binop_max:
    case ir_binop_pow:
+      assert(ir->operands[0]->type->base_type ==
+             ir->operands[1]->type->base_type);
+
       if (ir->operands[0]->type->is_scalar())
         assert(ir->operands[1]->type == ir->type);
       else if (ir->operands[1]->type->is_scalar())