summaryrefslogtreecommitdiff
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2011-01-07 18:34:58 -0800
committerIan Romanick <ian.d.romanick@intel.com>2011-01-12 14:30:31 -0800
commitbd33055ef4b6dd18d6247ff7d9e47496ff4acc51 (patch)
tree3278235f89711604cd0f9349ab8ea9270bbd1baa /src/glsl/ir.h
parentc3f000b3926988124a44ce7e8cd6588e46063058 (diff)
glsl: Track variable usage, use that to enforce semantics
In particular, variables cannot be redeclared invariant after being used. Fixes piglit test invariant-05.vert and bugzilla #29164. NOTE: This is a candidate for the 7.9 and 7.10 branches.
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 9668c9439a..57e89f0f6b 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -295,6 +295,15 @@ public:
unsigned invariant:1;
/**
+ * Has this variable been used for reading or writing?
+ *
+ * Several GLSL semantic checks require knowledge of whether or not a
+ * variable has been used. For example, it is an error to redeclare a
+ * variable as invariant after it has been used.
+ */
+ unsigned used:1;
+
+ /**
* Storage class of the variable.
*
* \sa ir_variable_mode