diff options
author | marha <marha@users.sourceforge.net> | 2012-02-13 08:50:32 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-02-13 08:50:32 +0100 |
commit | 179ebdfaf7fe0a0017054c052b76210eeff084a9 (patch) | |
tree | 5daa6e5583ced6a6b12b03e12c16ef2acedb5b5c /mesalib/src/glsl | |
parent | 535951cba015f2a2b63292e0ca983d0d6e736b71 (diff) | |
parent | eaa70945cb3f1a432b8c505ecede9ebc7769f36d (diff) | |
download | vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.tar.gz vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.tar.bz2 vcxsrv-179ebdfaf7fe0a0017054c052b76210eeff084a9.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r-- | mesalib/src/glsl/Android.mk | 1 | ||||
-rw-r--r-- | mesalib/src/glsl/loop_unroll.cpp | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/mesalib/src/glsl/Android.mk b/mesalib/src/glsl/Android.mk index 754f3cced..cf793d65e 100644 --- a/mesalib/src/glsl/Android.mk +++ b/mesalib/src/glsl/Android.mk @@ -39,6 +39,7 @@ LOCAL_SRC_FILES := \ $(LIBGLSL_CXX_FILES) LOCAL_C_INCLUDES := \ + external/astl/include \ $(MESA_TOP)/src/mapi \ $(MESA_TOP)/src/mesa diff --git a/mesalib/src/glsl/loop_unroll.cpp b/mesalib/src/glsl/loop_unroll.cpp index 5b84e1014..d0bcaa670 100644 --- a/mesalib/src/glsl/loop_unroll.cpp +++ b/mesalib/src/glsl/loop_unroll.cpp @@ -56,6 +56,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) { loop_variable_state *const ls = this->state->get(ir); int iterations; + unsigned ir_count; /* If we've entered a loop that hasn't been analyzed, something really, * really bad has happened. @@ -78,6 +79,20 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) if (iterations > (int) max_iterations) return visit_continue; + /* Don't try to unroll nested loops and loops with a huge body. + */ + ir_count = 0; + foreach_list(node, &ir->body_instructions) { + ++ir_count; + + /* If the loop body gets to huge, do not unroll. */ + if (5*max_iterations < ir_count*iterations) + return visit_continue; + /* Do not unroll loops with child loop nodes. */ + if (((ir_instruction *) node)->as_loop()) + return visit_continue; + } + if (ls->num_loop_jumps > 1) return visit_continue; else if (ls->num_loop_jumps) { |