glsl: Add ir_variable::interface_type field
[mesa.git] / src / glsl / ir.h
index 9fdfb18e25b14c448e621ab300d0c5e08456eee2..ff47b3a5a80b00da9e20371dffceb834a49f3422 100644 (file)
@@ -349,6 +349,14 @@ public:
     */
    glsl_interp_qualifier determine_interpolation_mode(bool flat_shade);
 
+   /**
+    * Determine whether or not a variable is part of a uniform block.
+    */
+   inline bool is_in_uniform_block() const
+   {
+      return this->mode == ir_var_uniform && this->interface_type != NULL;
+   }
+
    /**
     * Declared type of the variable
     */
@@ -532,6 +540,14 @@ public:
     * objects.
     */
    ir_constant *constant_initializer;
+
+   /**
+    * For variables that are in an interface block or are an instance of an
+    * interface block, this is the \c GLSL_TYPE_INTERFACE type for that block.
+    *
+    * \sa ir_variable::location
+    */
+   const glsl_type *interface_type;
 };