glsl: Add unsized array support to glsl_type::std140_size()
[mesa.git] / src / glsl / ir.h
index bb7fa0e0af4358d16819fb0de5a8ca8da87c02d8..48b6795cc0988ea7403c03412db8e66e2d22a981 100644 (file)
@@ -452,6 +452,15 @@ public:
              this->interface_type != NULL;
    }
 
+   /**
+    * Determine whether or not a variable is part of a shader storage block.
+    */
+   inline bool is_in_shader_storage_block() const
+   {
+      return this->data.mode == ir_var_shader_storage &&
+             this->interface_type != NULL;
+   }
+
    /**
     * Determine whether or not a variable is the declaration of an interface
     * block
@@ -777,6 +786,11 @@ public:
       unsigned image_volatile:1;
       unsigned image_restrict:1;
 
+      /**
+       * ARB_shader_storage_buffer_object
+       */
+      unsigned from_ssbo_unsized_array:1; /**< unsized array buffer variable. */
+
       /**
        * Emit a warning if this variable is accessed.
        */
@@ -819,6 +833,8 @@ public:
        *   - Fragment shader output: one of the values from \c gl_frag_result.
        *   - Uniforms: Per-stage uniform slot number for default uniform block.
        *   - Uniforms: Index within the uniform block definition for UBO members.
+       *   - Non-UBO Uniforms: explicit location until linking then reused to
+       *     store uniform slot number.
        *   - Other: This field is not currently used.
        *
        * If the variable is a uniform, shader input, or shader output, and the
@@ -2513,6 +2529,9 @@ extern void
 _mesa_glsl_initialize_variables(exec_list *instructions,
                                struct _mesa_glsl_parse_state *state);
 
+extern void
+_mesa_glsl_initialize_derived_variables(gl_shader *shader);
+
 extern void
 _mesa_glsl_initialize_functions(_mesa_glsl_parse_state *state);
 
@@ -2529,6 +2548,9 @@ _mesa_glsl_find_builtin_function_by_name(const char *name);
 extern gl_shader *
 _mesa_glsl_get_builtin_function_shader(void);
 
+extern ir_function_signature *
+_mesa_get_main_function_signature(gl_shader *sh);
+
 extern void
 _mesa_glsl_release_functions(void);