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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/loop_analysis.h b/src/glsl/loop_analysis.h
index 961ea40c079..8e57dacbf6b 100644
--- a/src/glsl/loop_analysis.h
+++ b/src/glsl/loop_analysis.h
@@ -189,6 +189,15 @@ public:
ir_rvalue *increment;
+ inline bool is_induction_var() const
+ {
+ /* Induction variables always have a non-null increment, and vice
+ * versa.
+ */
+ return this->increment != NULL;
+ }
+
+
inline bool is_loop_constant() const
{
const bool is_const = (this->num_assignments == 0)