X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fglsl%2Fopt_rebalance_tree.cpp;h=095f2d7d2f079b7e7a57212de23f3b70388d5eca;hb=3ca67f881040b4f3ecdf9b91a7f3f0bf51cf1544;hp=7ef0d2db39209aa7fbede1da21ee8b316f83ae6a;hpb=9697f8088f9e1c1b1f1b39b57a26ac4bd21b247f;p=mesa.git diff --git a/src/glsl/opt_rebalance_tree.cpp b/src/glsl/opt_rebalance_tree.cpp index 7ef0d2db392..095f2d7d2f0 100644 --- a/src/glsl/opt_rebalance_tree.cpp +++ b/src/glsl/opt_rebalance_tree.cpp @@ -271,11 +271,13 @@ update_types(ir_instruction *ir, void *) if (!expr) return; - expr->type = + const glsl_type *const new_type = glsl_type::get_instance(expr->type->base_type, - MAX2(expr->operands[0]->type->components(), - expr->operands[1]->type->components()), + MAX2(expr->operands[0]->type->vector_elements, + expr->operands[1]->type->vector_elements), 1); + assert(new_type != glsl_type::error_type); + expr->type = new_type; } void