From: Kenneth Graunke Date: Mon, 7 Apr 2014 05:45:43 +0000 (-0700) Subject: glsl: Validate that base types match for a number of binops. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40d9337406709d0e5e143c51dc5d57921a91aab9;p=mesa.git glsl: Validate that base types match for a number of binops. The IR is not supposed to support implicit type conversions; we just failed to validate it. Signed-off-by: Kenneth Graunke Reviewed-by: Ian Romanick Reviewed-by: Matt Turner --- diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 527acea4c35..71defc81593 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -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())