From e27333a568aa97a897b0e4129d55dfbaf7dddb9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 4 Nov 2016 12:57:53 +0100 Subject: [PATCH] glsl: don't run loop passes if loop unrolling is disabled Reviewed-by: Kenneth Graunke --- src/compiler/glsl/glsl_parser_extras.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index db659adf3e0..0cb3c124ea5 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -2108,12 +2108,14 @@ do_common_optimization(exec_list *ir, bool linked, OPT(optimize_split_arrays, ir, linked); OPT(optimize_redundant_jumps, ir); - loop_state *ls = analyze_loop_variables(ir); - if (ls->loop_found) { - OPT(set_loop_controls, ir, ls); - OPT(unroll_loops, ir, ls, options); + if (options->MaxUnrollIterations) { + loop_state *ls = analyze_loop_variables(ir); + if (ls->loop_found) { + OPT(set_loop_controls, ir, ls); + OPT(unroll_loops, ir, ls, options); + } + delete ls; } - delete ls; #undef OPT -- 2.30.2