summaryrefslogtreecommitdiffstats
path: root/src/glsl/loop_analysis.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-08-27 13:59:49 -0700
committerIan Romanick <[email protected]>2010-09-03 11:55:22 -0700
commitde7c3fe31a7b88a5392dceee3b13b45ed78cdeae (patch)
tree8fab99f244e9cc2daff2226faa5d8eb994102a71 /src/glsl/loop_analysis.h
parent3bcfafcf0320ee5407716ff67062e80d162760d4 (diff)
glsl2: Add module to perform simple loop unrolling
Diffstat (limited to 'src/glsl/loop_analysis.h')
-rw-r--r--src/glsl/loop_analysis.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h
index f5c5a04be81..893dd46db04 100644
--- a/src/glsl/loop_analysis.h
+++ b/src/glsl/loop_analysis.h
@@ -56,6 +56,10 @@ extern bool
set_loop_controls(exec_list *instructions, loop_state *ls);
+extern bool
+unroll_loops(exec_list *instructions, loop_state *ls);
+
+
/**
* Tracking for all variables used in a loop
*/
@@ -105,12 +109,22 @@ public:
hash_table *var_hash;
/**
+ * Maximum number of loop iterations.
+ *
+ * If this value is negative, then the loop may be infinite. This actually
+ * means that analysis was unable to determine an upper bound on the number
+ * of loop iterations.
+ */
+ int max_iterations;
+
+ /**
* Number of ir_loop_jump instructions that operate on this loop
*/
unsigned num_loop_jumps;
loop_variable_state()
{
+ this->max_iterations = -1;
this->num_loop_jumps = 0;
this->var_hash = hash_table_ctor(0, hash_table_pointer_hash,
hash_table_pointer_compare);