summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-03-29 17:02:15 -0700
committerEric Anholt <eric@anholt.net>2012-04-19 16:33:36 -0700
commitf2475ca424f7e001be50f64dafa5700f6603d684 (patch)
tree432e0d9c8da042785c8fb6de1aa70a2eeed89eae /src/glsl/ir.h
parentcc7e0de009a0ab528fe950b17fa465a0a97988fc (diff)
glsl: Track in each ir_variable whether it was ever assigned.
This will be used for some compile-and-link-time error checking, where currently we've been doing error checking only at link time. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index d6c6a607ae8..ddfaf3614ae 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -353,10 +353,23 @@ public:
* 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.
+ *
+ * This is only maintained in the ast_to_hir.cpp path, not in
+ * Mesa's fixed function or ARB program paths.
*/
unsigned used:1;
/**
+ * Has this variable been statically assigned?
+ *
+ * This answers whether the variable was assigned in any path of
+ * the shader during ast_to_hir. This doesn't answer whether it is
+ * still written after dead code removal, nor is it maintained in
+ * non-ast_to_hir.cpp (GLSL parsing) paths.
+ */
+ unsigned assigned:1;
+
+ /**
* Storage class of the variable.
*
* \sa ir_variable_mode