This will make expansion easier and less cluttered. Signed-off-by: Thomas Helland <thomashellan...@gmail.com> --- src/glsl/opt_minmax.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/glsl/opt_minmax.cpp b/src/glsl/opt_minmax.cpp index e4141bc..b21daca 100644 --- a/src/glsl/opt_minmax.cpp +++ b/src/glsl/opt_minmax.cpp @@ -269,11 +269,16 @@ static minmax_range get_range(ir_rvalue *rval) { ir_expression *expr = rval->as_expression(); - if (expr && (expr->operation == ir_binop_min || - expr->operation == ir_binop_max)) { - minmax_range r0 = get_range(expr->operands[0]); - minmax_range r1 = get_range(expr->operands[1]); - return combine_range(r0, r1, expr->operation == ir_binop_min); + minmax_range r0; + minmax_range r1; + + if(expr) { + switch(expr->operation) { + case ir_binop_min: + case ir_binop_max: + r0 = get_range(expr->operands[0]); + r1 = get_range(expr->operands[1]); + return combine_range(r0, r1, expr->operation == ir_binop_min); } ir_constant *c = rval->as_constant(); -- 2.0.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev