glsl: Implement type inferencing of matrix types.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
This commit is contained in:
Matt Turner 2015-03-27 10:45:07 -07:00
parent 73f6f9b9be
commit cf2dc1624f

View file

@ -380,10 +380,12 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
} else if (op1->type->is_scalar()) { } else if (op1->type->is_scalar()) {
this->type = op0->type; this->type = op0->type;
} else { } else {
/* FINISHME: matrix types */ if (this->operation == ir_binop_mul) {
assert(!op0->type->is_matrix() && !op1->type->is_matrix()); this->type = glsl_type::get_mul_type(op0->type, op1->type);
assert(op0->type == op1->type); } else {
this->type = op0->type; assert(op0->type == op1->type);
this->type = op0->type;
}
} }
break; break;