3 * Copyright © 2009 Intel Corporation
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
30 #include "glsl_parser_extras.h"
32 struct _mesa_glsl_parse_state
;
37 * \defgroup AST Abstract syntax tree node definitions
39 * An abstract syntax tree is generated by the parser. This is a fairly
40 * direct representation of the gramma derivation for the source program.
41 * No symantic checking is done during the generation of the AST. Only
42 * syntactic checking is done. Symantic checking is performed by a later
43 * stage that converts the AST to a more generic intermediate representation.
48 * Base class of all abstract syntax tree nodes
52 DECLARE_RALLOC_CXX_OPERATORS(ast_node
);
55 * Print an AST node in something approximating the original GLSL code
57 virtual void print(void) const;
60 * Convert the AST node to the high-level intermediate representation
62 virtual ir_rvalue
*hir(exec_list
*instructions
,
63 struct _mesa_glsl_parse_state
*state
);
66 * Retrieve the source location of an AST node
68 * This function is primarily used to get the source position of an AST node
69 * into a form that can be passed to \c _mesa_glsl_error.
71 * \sa _mesa_glsl_error, ast_node::set_location
73 struct YYLTYPE
get_location(void) const
77 locp
.source
= this->location
.source
;
78 locp
.first_line
= this->location
.first_line
;
79 locp
.first_column
= this->location
.first_column
;
80 locp
.last_line
= this->location
.last_line
;
81 locp
.last_column
= this->location
.last_column
;
87 * Set the source location of an AST node from a parser location
89 * \sa ast_node::get_location
91 void set_location(const struct YYLTYPE
&locp
)
93 this->location
.source
= locp
.source
;
94 this->location
.first_line
= locp
.first_line
;
95 this->location
.first_column
= locp
.first_column
;
96 this->location
.last_line
= locp
.last_line
;
97 this->location
.last_column
= locp
.last_column
;
101 * Set the source location range of an AST node using two location nodes
103 * \sa ast_node::set_location
105 void set_location_range(const struct YYLTYPE
&begin
, const struct YYLTYPE
&end
)
107 this->location
.source
= begin
.source
;
108 this->location
.first_line
= begin
.first_line
;
109 this->location
.last_line
= end
.last_line
;
110 this->location
.first_column
= begin
.first_column
;
111 this->location
.last_column
= end
.last_column
;
115 * Source location of the AST node.
118 unsigned source
; /**< GLSL source number. */
119 unsigned first_line
; /**< First line number within the source string. */
120 unsigned first_column
; /**< First column in the first line. */
121 unsigned last_line
; /**< Last line number within the source string. */
122 unsigned last_column
; /**< Last column in the last line. */
129 * The only constructor is protected so that only derived class objects can
137 * Operators for AST expression nodes.
141 ast_plus
, /**< Unary + operator. */
198 * Representation of any sort of expression.
200 class ast_expression
: public ast_node
{
202 ast_expression(int oper
, ast_expression
*,
203 ast_expression
*, ast_expression
*);
205 ast_expression(const char *identifier
) :
208 subexpressions
[0] = NULL
;
209 subexpressions
[1] = NULL
;
210 subexpressions
[2] = NULL
;
211 primary_expression
.identifier
= identifier
;
212 this->non_lvalue_description
= NULL
;
215 static const char *operator_string(enum ast_operators op
);
217 virtual ir_rvalue
*hir(exec_list
*instructions
,
218 struct _mesa_glsl_parse_state
*state
);
220 virtual void hir_no_rvalue(exec_list
*instructions
,
221 struct _mesa_glsl_parse_state
*state
);
223 ir_rvalue
*do_hir(exec_list
*instructions
,
224 struct _mesa_glsl_parse_state
*state
,
227 virtual void print(void) const;
229 enum ast_operators oper
;
231 ast_expression
*subexpressions
[3];
234 const char *identifier
;
236 float float_constant
;
237 unsigned uint_constant
;
239 } primary_expression
;
243 * List of expressions for an \c ast_sequence or parameters for an
244 * \c ast_function_call
246 exec_list expressions
;
249 * For things that can't be l-values, this describes what it is.
251 * This text is used by the code that generates IR for assignments to
252 * detect and emit useful messages for assignments to some things that
253 * can't be l-values. For example, pre- or post-incerement expressions.
256 * This pointer may be \c NULL.
258 const char *non_lvalue_description
;
261 class ast_expression_bin
: public ast_expression
{
263 ast_expression_bin(int oper
, ast_expression
*, ast_expression
*);
265 virtual void print(void) const;
269 * Subclass of expressions for function calls
271 class ast_function_expression
: public ast_expression
{
273 ast_function_expression(ast_expression
*callee
)
274 : ast_expression(ast_function_call
, callee
,
281 ast_function_expression(class ast_type_specifier
*type
)
282 : ast_expression(ast_function_call
, (ast_expression
*) type
,
289 bool is_constructor() const
294 virtual ir_rvalue
*hir(exec_list
*instructions
,
295 struct _mesa_glsl_parse_state
*state
);
297 virtual void hir_no_rvalue(exec_list
*instructions
,
298 struct _mesa_glsl_parse_state
*state
);
302 * Is this function call actually a constructor?
307 class ast_array_specifier
: public ast_node
{
309 /** Unsized array specifier ([]) */
310 explicit ast_array_specifier(const struct YYLTYPE
&locp
)
311 : is_unsized_array(true)
316 /** Sized array specifier ([dim]) */
317 ast_array_specifier(const struct YYLTYPE
&locp
, ast_expression
*dim
)
318 : is_unsized_array(false)
321 array_dimensions
.push_tail(&dim
->link
);
324 void add_dimension(ast_expression
*dim
)
326 array_dimensions
.push_tail(&dim
->link
);
329 virtual void print(void) const;
331 /* If true, this means that the array has an unsized outermost dimension. */
332 bool is_unsized_array
;
334 /* This list contains objects of type ast_node containing the
335 * sized dimensions only, in outermost-to-innermost order.
337 exec_list array_dimensions
;
341 * C-style aggregate initialization class
343 * Represents C-style initializers of vectors, matrices, arrays, and
344 * structures. E.g., vec3 pos = {1.0, 0.0, -1.0} is equivalent to
345 * vec3 pos = vec3(1.0, 0.0, -1.0).
347 * Specified in GLSL 4.20 and GL_ARB_shading_language_420pack.
349 * \sa _mesa_ast_set_aggregate_type
351 class ast_aggregate_initializer
: public ast_expression
{
353 ast_aggregate_initializer()
354 : ast_expression(ast_aggregate
, NULL
, NULL
, NULL
),
355 constructor_type(NULL
)
361 * glsl_type of the aggregate, which is inferred from the LHS of whatever
362 * the aggregate is being used to initialize. This can't be inferred at
363 * parse time (since the parser deals with ast_type_specifiers, not
364 * glsl_types), so the parser leaves it NULL. However, the ast-to-hir
365 * conversion code makes sure to fill it in with the appropriate type
366 * before hir() is called.
368 const glsl_type
*constructor_type
;
370 virtual ir_rvalue
*hir(exec_list
*instructions
,
371 struct _mesa_glsl_parse_state
*state
);
373 virtual void hir_no_rvalue(exec_list
*instructions
,
374 struct _mesa_glsl_parse_state
*state
);
378 * Number of possible operators for an ast_expression
380 * This is done as a define instead of as an additional value in the enum so
381 * that the compiler won't generate spurious messages like "warning:
382 * enumeration value ‘ast_num_operators’ not handled in switch"
384 #define AST_NUM_OPERATORS (ast_sequence + 1)
387 class ast_compound_statement
: public ast_node
{
389 ast_compound_statement(int new_scope
, ast_node
*statements
);
390 virtual void print(void) const;
392 virtual ir_rvalue
*hir(exec_list
*instructions
,
393 struct _mesa_glsl_parse_state
*state
);
396 exec_list statements
;
399 class ast_declaration
: public ast_node
{
401 ast_declaration(const char *identifier
,
402 ast_array_specifier
*array_specifier
,
403 ast_expression
*initializer
);
404 virtual void print(void) const;
406 const char *identifier
;
408 ast_array_specifier
*array_specifier
;
410 ast_expression
*initializer
;
415 ast_precision_none
= 0, /**< Absence of precision qualifier. */
417 ast_precision_medium
,
421 struct ast_type_qualifier
{
422 DECLARE_RALLOC_CXX_OPERATORS(ast_type_qualifier
);
426 unsigned invariant
:1;
429 unsigned attribute
:1;
438 unsigned noperspective
:1;
440 /** \name Layout qualifiers for GL_ARB_fragment_coord_conventions */
442 unsigned origin_upper_left
:1;
443 unsigned pixel_center_integer
:1;
447 * Flag set if GL_ARB_explicit_attrib_location "location" layout
450 unsigned explicit_location
:1;
452 * Flag set if GL_ARB_explicit_attrib_location "index" layout
455 unsigned explicit_index
:1;
458 * Flag set if GL_ARB_shading_language_420pack "binding" layout
461 unsigned explicit_binding
:1;
464 * Flag set if GL_ARB_shader_atomic counter "offset" layout
467 unsigned explicit_offset
:1;
469 /** \name Layout qualifiers for GL_AMD_conservative_depth */
471 unsigned depth_any
:1;
472 unsigned depth_greater
:1;
473 unsigned depth_less
:1;
474 unsigned depth_unchanged
:1;
477 /** \name Layout qualifiers for GL_ARB_uniform_buffer_object */
482 unsigned column_major
:1;
483 unsigned row_major
:1;
486 /** \name Layout qualifiers for GLSL 1.50 geometry shaders */
488 unsigned prim_type
:1;
489 unsigned max_vertices
:1;
493 * local_size_{x,y,z} flags for compute shaders. Bit 0 represents
494 * local_size_x, and so on.
496 unsigned local_size
:3;
498 /** \name Layout and memory qualifiers for ARB_shader_image_load_store. */
500 unsigned early_fragment_tests
:1;
501 unsigned explicit_image_format
:1;
503 unsigned _volatile
:1;
504 unsigned restrict_flag
:1;
505 unsigned read_only
:1; /**< "readonly" qualifier. */
506 unsigned write_only
:1; /**< "writeonly" qualifier. */
509 /** \name Layout qualifiers for GL_ARB_gpu_shader5 */
511 unsigned invocations
:1;
514 /** \brief Set of flags, accessed by name. */
517 /** \brief Set of flags, accessed as a bitmask. */
521 /** Precision of the type (highp/medium/lowp). */
522 unsigned precision
:2;
524 /** Geometry shader invocations for GL_ARB_gpu_shader5. */
528 * Location specified via GL_ARB_explicit_attrib_location layout
531 * This field is only valid if \c explicit_location is set.
535 * Index specified via GL_ARB_explicit_attrib_location layout
538 * This field is only valid if \c explicit_index is set.
542 /** Maximum output vertices in GLSL 1.50 geometry shaders. */
545 /** Input or output primitive type in GLSL 1.50 geometry shaders */
549 * Binding specified via GL_ARB_shading_language_420pack's "binding" keyword.
552 * This field is only valid if \c explicit_binding is set.
557 * Offset specified via GL_ARB_shader_atomic_counter's "offset"
561 * This field is only valid if \c explicit_offset is set.
566 * Local size specified via GL_ARB_compute_shader's "local_size_{x,y,z}"
567 * layout qualifier. Element i of this array is only valid if
568 * flags.q.local_size & (1 << i) is set.
573 * Image format specified with an ARB_shader_image_load_store
577 * This field is only valid if \c explicit_image_format is set.
582 * Base type of the data read from or written to this image. Only
583 * the following enumerants are allowed: GLSL_TYPE_UINT,
584 * GLSL_TYPE_INT, GLSL_TYPE_FLOAT.
587 * This field is only valid if \c explicit_image_format is set.
589 glsl_base_type image_base_type
;
592 * Return true if and only if an interpolation qualifier is present.
594 bool has_interpolation() const;
597 * Return whether a layout qualifier is present.
599 bool has_layout() const;
602 * Return whether a storage qualifier is present.
604 bool has_storage() const;
607 * Return whether an auxiliary storage qualifier is present.
609 bool has_auxiliary_storage() const;
612 * \brief Return string representation of interpolation qualifier.
614 * If an interpolation qualifier is present, then return that qualifier's
615 * string representation. Otherwise, return null. For example, if the
616 * noperspective bit is set, then this returns "noperspective".
618 * If multiple interpolation qualifiers are somehow present, then the
619 * returned string is undefined but not null.
621 const char *interpolation_string() const;
623 bool merge_qualifier(YYLTYPE
*loc
,
624 _mesa_glsl_parse_state
*state
,
625 ast_type_qualifier q
);
627 bool merge_in_qualifier(YYLTYPE
*loc
,
628 _mesa_glsl_parse_state
*state
,
629 ast_type_qualifier q
,
634 class ast_declarator_list
;
636 class ast_struct_specifier
: public ast_node
{
639 * \brief Make a shallow copy of an ast_struct_specifier.
641 * Use only if the objects are allocated from the same context and will not
642 * be modified. Zeros the inherited ast_node's fields.
644 ast_struct_specifier(const ast_struct_specifier
& that
):
645 ast_node(), name(that
.name
), declarations(that
.declarations
),
646 is_declaration(that
.is_declaration
)
651 ast_struct_specifier(const char *identifier
,
652 ast_declarator_list
*declarator_list
);
653 virtual void print(void) const;
655 virtual ir_rvalue
*hir(exec_list
*instructions
,
656 struct _mesa_glsl_parse_state
*state
);
659 /* List of ast_declarator_list * */
660 exec_list declarations
;
666 class ast_type_specifier
: public ast_node
{
669 * \brief Make a shallow copy of an ast_type_specifier, specifying array
672 * Use only if the objects are allocated from the same context and will not
673 * be modified. Zeros the inherited ast_node's fields.
675 ast_type_specifier(const ast_type_specifier
*that
,
676 ast_array_specifier
*array_specifier
)
677 : ast_node(), type_name(that
->type_name
), structure(that
->structure
),
678 array_specifier(array_specifier
),
679 default_precision(that
->default_precision
)
684 /** Construct a type specifier from a type name */
685 ast_type_specifier(const char *name
)
686 : type_name(name
), structure(NULL
), array_specifier(NULL
),
687 default_precision(ast_precision_none
)
692 /** Construct a type specifier from a structure definition */
693 ast_type_specifier(ast_struct_specifier
*s
)
694 : type_name(s
->name
), structure(s
), array_specifier(NULL
),
695 default_precision(ast_precision_none
)
700 const struct glsl_type
*glsl_type(const char **name
,
701 struct _mesa_glsl_parse_state
*state
)
704 virtual void print(void) const;
706 ir_rvalue
*hir(exec_list
*, struct _mesa_glsl_parse_state
*);
708 const char *type_name
;
709 ast_struct_specifier
*structure
;
711 ast_array_specifier
*array_specifier
;
713 /** For precision statements, this is the given precision; otherwise none. */
714 unsigned default_precision
:2;
718 class ast_fully_specified_type
: public ast_node
{
720 virtual void print(void) const;
721 bool has_qualifiers() const;
723 ast_fully_specified_type() : qualifier(), specifier(NULL
)
727 const struct glsl_type
*glsl_type(const char **name
,
728 struct _mesa_glsl_parse_state
*state
)
731 ast_type_qualifier qualifier
;
732 ast_type_specifier
*specifier
;
736 class ast_declarator_list
: public ast_node
{
738 ast_declarator_list(ast_fully_specified_type
*);
739 virtual void print(void) const;
741 virtual ir_rvalue
*hir(exec_list
*instructions
,
742 struct _mesa_glsl_parse_state
*state
);
744 ast_fully_specified_type
*type
;
745 /** List of 'ast_declaration *' */
746 exec_list declarations
;
749 * Special flag for vertex shader "invariant" declarations.
751 * Vertex shaders can contain "invariant" variable redeclarations that do
752 * not include a type. For example, "invariant gl_Position;". This flag
753 * is used to note these cases when no type is specified.
759 class ast_parameter_declarator
: public ast_node
{
761 ast_parameter_declarator() :
764 array_specifier(NULL
),
765 formal_parameter(false),
771 virtual void print(void) const;
773 virtual ir_rvalue
*hir(exec_list
*instructions
,
774 struct _mesa_glsl_parse_state
*state
);
776 ast_fully_specified_type
*type
;
777 const char *identifier
;
778 ast_array_specifier
*array_specifier
;
780 static void parameters_to_hir(exec_list
*ast_parameters
,
781 bool formal
, exec_list
*ir_parameters
,
782 struct _mesa_glsl_parse_state
*state
);
785 /** Is this parameter declaration part of a formal parameter list? */
786 bool formal_parameter
;
789 * Is this parameter 'void' type?
791 * This field is set by \c ::hir.
797 class ast_function
: public ast_node
{
801 virtual void print(void) const;
803 virtual ir_rvalue
*hir(exec_list
*instructions
,
804 struct _mesa_glsl_parse_state
*state
);
806 ast_fully_specified_type
*return_type
;
807 const char *identifier
;
809 exec_list parameters
;
813 * Is this prototype part of the function definition?
815 * Used by ast_function_definition::hir to process the parameters, etc.
823 * Function signature corresponding to this function prototype instance
825 * Used by ast_function_definition::hir to process the parameters, etc.
830 class ir_function_signature
*signature
;
832 friend class ast_function_definition
;
836 class ast_expression_statement
: public ast_node
{
838 ast_expression_statement(ast_expression
*);
839 virtual void print(void) const;
841 virtual ir_rvalue
*hir(exec_list
*instructions
,
842 struct _mesa_glsl_parse_state
*state
);
844 ast_expression
*expression
;
848 class ast_case_label
: public ast_node
{
850 ast_case_label(ast_expression
*test_value
);
851 virtual void print(void) const;
853 virtual ir_rvalue
*hir(exec_list
*instructions
,
854 struct _mesa_glsl_parse_state
*state
);
857 * An test value of NULL means 'default'.
859 ast_expression
*test_value
;
863 class ast_case_label_list
: public ast_node
{
865 ast_case_label_list(void);
866 virtual void print(void) const;
868 virtual ir_rvalue
*hir(exec_list
*instructions
,
869 struct _mesa_glsl_parse_state
*state
);
872 * A list of case labels.
878 class ast_case_statement
: public ast_node
{
880 ast_case_statement(ast_case_label_list
*labels
);
881 virtual void print(void) const;
883 virtual ir_rvalue
*hir(exec_list
*instructions
,
884 struct _mesa_glsl_parse_state
*state
);
886 ast_case_label_list
*labels
;
889 * A list of statements.
895 class ast_case_statement_list
: public ast_node
{
897 ast_case_statement_list(void);
898 virtual void print(void) const;
900 virtual ir_rvalue
*hir(exec_list
*instructions
,
901 struct _mesa_glsl_parse_state
*state
);
910 class ast_switch_body
: public ast_node
{
912 ast_switch_body(ast_case_statement_list
*stmts
);
913 virtual void print(void) const;
915 virtual ir_rvalue
*hir(exec_list
*instructions
,
916 struct _mesa_glsl_parse_state
*state
);
918 ast_case_statement_list
*stmts
;
922 class ast_selection_statement
: public ast_node
{
924 ast_selection_statement(ast_expression
*condition
,
925 ast_node
*then_statement
,
926 ast_node
*else_statement
);
927 virtual void print(void) const;
929 virtual ir_rvalue
*hir(exec_list
*instructions
,
930 struct _mesa_glsl_parse_state
*state
);
932 ast_expression
*condition
;
933 ast_node
*then_statement
;
934 ast_node
*else_statement
;
938 class ast_switch_statement
: public ast_node
{
940 ast_switch_statement(ast_expression
*test_expression
,
942 virtual void print(void) const;
944 virtual ir_rvalue
*hir(exec_list
*instructions
,
945 struct _mesa_glsl_parse_state
*state
);
947 ast_expression
*test_expression
;
951 void test_to_hir(exec_list
*, struct _mesa_glsl_parse_state
*);
954 class ast_iteration_statement
: public ast_node
{
956 ast_iteration_statement(int mode
, ast_node
*init
, ast_node
*condition
,
957 ast_expression
*rest_expression
, ast_node
*body
);
959 virtual void print(void) const;
961 virtual ir_rvalue
*hir(exec_list
*, struct _mesa_glsl_parse_state
*);
963 enum ast_iteration_modes
{
970 ast_node
*init_statement
;
972 ast_expression
*rest_expression
;
977 * Generate IR from the condition of a loop
979 * This is factored out of ::hir because some loops have the condition
980 * test at the top (for and while), and others have it at the end (do-while).
982 void condition_to_hir(exec_list
*, struct _mesa_glsl_parse_state
*);
986 class ast_jump_statement
: public ast_node
{
988 ast_jump_statement(int mode
, ast_expression
*return_value
);
989 virtual void print(void) const;
991 virtual ir_rvalue
*hir(exec_list
*instructions
,
992 struct _mesa_glsl_parse_state
*state
);
994 enum ast_jump_modes
{
1001 ast_expression
*opt_return_value
;
1005 class ast_function_definition
: public ast_node
{
1007 ast_function_definition() : prototype(NULL
), body(NULL
)
1011 virtual void print(void) const;
1013 virtual ir_rvalue
*hir(exec_list
*instructions
,
1014 struct _mesa_glsl_parse_state
*state
);
1016 ast_function
*prototype
;
1017 ast_compound_statement
*body
;
1020 class ast_interface_block
: public ast_node
{
1022 ast_interface_block(ast_type_qualifier layout
,
1023 const char *instance_name
,
1024 ast_array_specifier
*array_specifier
)
1025 : layout(layout
), block_name(NULL
), instance_name(instance_name
),
1026 array_specifier(array_specifier
)
1030 virtual ir_rvalue
*hir(exec_list
*instructions
,
1031 struct _mesa_glsl_parse_state
*state
);
1033 ast_type_qualifier layout
;
1034 const char *block_name
;
1037 * Declared name of the block instance, if specified.
1039 * If the block does not have an instance name, this field will be
1042 const char *instance_name
;
1044 /** List of ast_declarator_list * */
1045 exec_list declarations
;
1048 * Declared array size of the block instance
1050 * If the block is not declared as an array or if the block instance array
1051 * is unsized, this field will be \c NULL.
1053 ast_array_specifier
*array_specifier
;
1058 * AST node representing a declaration of the input layout for geometry
1061 class ast_gs_input_layout
: public ast_node
1064 ast_gs_input_layout(const struct YYLTYPE
&locp
, GLenum prim_type
)
1065 : prim_type(prim_type
)
1070 virtual ir_rvalue
*hir(exec_list
*instructions
,
1071 struct _mesa_glsl_parse_state
*state
);
1074 const GLenum prim_type
;
1079 * AST node representing a decalaration of the input layout for compute
1082 class ast_cs_input_layout
: public ast_node
1085 ast_cs_input_layout(const struct YYLTYPE
&locp
, const unsigned *local_size
)
1087 memcpy(this->local_size
, local_size
, sizeof(this->local_size
));
1091 virtual ir_rvalue
*hir(exec_list
*instructions
,
1092 struct _mesa_glsl_parse_state
*state
);
1095 unsigned local_size
[3];
1101 _mesa_ast_to_hir(exec_list
*instructions
, struct _mesa_glsl_parse_state
*state
);
1104 _mesa_ast_field_selection_to_hir(const ast_expression
*expr
,
1105 exec_list
*instructions
,
1106 struct _mesa_glsl_parse_state
*state
);
1109 _mesa_ast_array_index_to_hir(void *mem_ctx
,
1110 struct _mesa_glsl_parse_state
*state
,
1111 ir_rvalue
*array
, ir_rvalue
*idx
,
1112 YYLTYPE
&loc
, YYLTYPE
&idx_loc
);
1115 _mesa_ast_set_aggregate_type(const glsl_type
*type
,
1116 ast_expression
*expr
);
1119 emit_function(_mesa_glsl_parse_state
*state
, ir_function
*f
);
1122 check_builtin_array_max_size(const char *name
, unsigned size
,
1123 YYLTYPE loc
, struct _mesa_glsl_parse_state
*state
);