diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2010-08-27 13:59:49 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-09-03 11:55:22 -0700 |
commit | de7c3fe31a7b88a5392dceee3b13b45ed78cdeae (patch) | |
tree | 8fab99f244e9cc2daff2226faa5d8eb994102a71 /src/glsl/loop_controls.cpp | |
parent | 3bcfafcf0320ee5407716ff67062e80d162760d4 (diff) | |
download | external_mesa3d-de7c3fe31a7b88a5392dceee3b13b45ed78cdeae.zip external_mesa3d-de7c3fe31a7b88a5392dceee3b13b45ed78cdeae.tar.gz external_mesa3d-de7c3fe31a7b88a5392dceee3b13b45ed78cdeae.tar.bz2 |
glsl2: Add module to perform simple loop unrolling
Diffstat (limited to 'src/glsl/loop_controls.cpp')
-rw-r--r-- | src/glsl/loop_controls.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp index f2e1ecb..d6a1e33 100644 --- a/src/glsl/loop_controls.cpp +++ b/src/glsl/loop_controls.cpp @@ -182,7 +182,7 @@ loop_control_visitor::visit_leave(ir_loop *ir) * i is a loop induction variable, c is a constant, and < is any relative * operator. */ - int max_iterations = INT_MAX; + int max_iterations = (ls->max_iterations < 0) ? INT_MAX : ls->max_iterations; foreach_list(node, &ls->terminators) { loop_terminator *t = (loop_terminator *) node; ir_if *if_stmt = t->ir; @@ -276,6 +276,8 @@ loop_control_visitor::visit_leave(ir_loop *ir) */ if (max_iterations == 0) ir->remove(); + else + ls->max_iterations = max_iterations; return visit_continue; } |