glsl: Track in each ir_variable whether it was ever assigned.
[mesa.git] / src / glsl / ir.h
index 9450e8f843042169990563263ffb6ffe5d9de53c..ddfaf3614aed3287467e8d62cc6e9d8c96402030 100644 (file)
@@ -353,9 +353,22 @@ 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.
     *
@@ -386,6 +399,7 @@ public:
     * no effect).
     */
    unsigned explicit_location:1;
+   unsigned explicit_index:1;
 
    /**
     * Does this variable have an initializer?