i965/vs: rename vec4_generator::generate_vs_instruction.
[mesa.git] / src / glsl / ast.h
index 7d7f72d54a419ec0f16955cf8da1f8536b6dd692..730027177e8912f9bb22047c844f6082980ca3b6 100644 (file)
@@ -547,11 +547,15 @@ public:
 
 class ast_parameter_declarator : public ast_node {
 public:
-   ast_parameter_declarator()
+   ast_parameter_declarator() :
+      type(NULL),
+      identifier(NULL),
+      is_array(false),
+      array_size(NULL),
+      formal_parameter(false),
+      is_void(false)
    {
-      this->identifier = NULL;
-      this->is_array = false;
-      this->array_size = 0;
+      /* empty */
    }
 
    virtual void print(void) const;
@@ -804,12 +808,12 @@ public:
 class ast_uniform_block : public ast_node {
 public:
    ast_uniform_block(ast_type_qualifier layout,
-                    const char *block_name,
-                    ast_declarator_list *member_list,
-                     const char *instance_name)
-   : layout(layout), block_name(block_name), instance_name(instance_name)
+                     const char *instance_name,
+                    ast_expression *array_size)
+   : layout(layout), block_name(NULL), instance_name(instance_name),
+     array_size(array_size)
    {
-      declarations.push_degenerate_list_at_head(&member_list->link);
+      /* empty */
    }
 
    virtual ir_rvalue *hir(exec_list *instructions,
@@ -828,6 +832,17 @@ public:
 
    /** List of ast_declarator_list * */
    exec_list declarations;
+
+   /**
+    * Declared array size of the block instance
+    *
+    * If the block is not declared as an array, this field will be \c NULL.
+    *
+    * \note
+    * A block can only be an array if it also has an instance name.  If this
+    * field is not \c NULL, ::instance_name must also not be \c NULL.
+    */
+   ast_expression *array_size;
 };
 /*@}*/
 
@@ -839,7 +854,17 @@ _mesa_ast_field_selection_to_hir(const ast_expression *expr,
                                 exec_list *instructions,
                                 struct _mesa_glsl_parse_state *state);
 
+extern ir_rvalue *
+_mesa_ast_array_index_to_hir(void *mem_ctx,
+                            struct _mesa_glsl_parse_state *state,
+                            ir_rvalue *array, ir_rvalue *idx,
+                            YYLTYPE &loc, YYLTYPE &idx_loc);
+
 void
 emit_function(_mesa_glsl_parse_state *state, ir_function *f);
 
+extern void
+check_builtin_array_max_size(const char *name, unsigned size,
+                             YYLTYPE loc, struct _mesa_glsl_parse_state *state);
+
 #endif /* AST_H */