diff options
author | Marek Olšák <[email protected]> | 2016-11-04 12:57:53 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-11-10 18:34:55 +0100 |
commit | e27333a568aa97a897b0e4129d55dfbaf7dddb9f (patch) | |
tree | 203dd21bdc5e2f64c68d76e2de1b04f15dbbcb37 | |
parent | ce3f453f0165d0ef29fa482e4ec1f89aa9706b1d (diff) |
glsl: don't run loop passes if loop unrolling is disabled
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/compiler/glsl/glsl_parser_extras.cpp | 12 |
1 files 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 |