summaryrefslogtreecommitdiffstats
path: root/src/glsl/loop_analysis.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/loop_analysis.h')
-rw-r--r--src/glsl/loop_analysis.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h
index 50c512f847f..b7c05149438 100644
--- a/src/glsl/loop_analysis.h
+++ b/src/glsl/loop_analysis.h
@@ -37,6 +37,26 @@ analyze_loop_variables(exec_list *instructions);
/**
+ * Fill in loop control fields
+ *
+ * Based on analysis of loop variables, this function tries to remove sequences
+ * in the loop of the form
+ *
+ * (if (expression bool ...) (break))
+ *
+ * and fill in the \c ir_loop::from, \c ir_loop::to, and \c ir_loop::counter
+ * fields of the \c ir_loop.
+ *
+ * In this process, some conditional break-statements may be eliminated
+ * altogether. For example, if it is provable that one loop exit condition will
+ * always be satisfied before another, the unnecessary exit condition will be
+ * removed.
+ */
+extern bool
+set_loop_controls(exec_list *instructions, loop_state *ls);
+
+
+/**
* Tracking for all variables used in a loop
*/
class loop_variable_state : public exec_node {