nir: Add a nir_foreach_uniform_variable helper
[mesa.git] / src / mesa / program / prog_parameter.h
index 570500420127fbfc98f5a4985c7cde4d1016c798..1fb0c5b7d1fbe920f0828558097cf69ee9827899 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef PROG_PARAMETER_H
 #define PROG_PARAMETER_H
 
+#include <stdbool.h>
+#include <stdint.h>
 #include "prog_statevars.h"
 
 #include <string.h>
@@ -91,8 +93,16 @@ typedef union gl_constant_value
 struct gl_program_parameter
 {
    const char *Name;        /**< Null-terminated string */
-   gl_register_file Type:16;  /**< PROGRAM_CONSTANT or STATE_VAR */
+   gl_register_file Type:5;  /**< PROGRAM_CONSTANT or STATE_VAR */
+
+   /**
+    * We need to keep track of whether the param is padded for use in the
+    * shader cache.
+    */
+   bool Padded:1;
+
    GLenum16 DataType;         /**< GL_FLOAT, GL_FLOAT_VEC2, etc */
+
    /**
     * Number of components (1..4), or more.
     * If the number of components is greater than 4,
@@ -106,10 +116,15 @@ struct gl_program_parameter
    gl_state_index16 StateIndexes[STATE_LENGTH];
 
    /**
-    * We need to keep track of whether the param is padded for use in the
-    * shader cache.
+    * Index of this parameter's uniform storage.
+    */
+   uint32_t UniformStorageIndex;
+
+   /**
+    * Index of the first uniform storage that is associated with the same
+    * variable as this parameter.
     */
-   bool Padded;
+   uint32_t MainUniformStorageIndex;
 };