2 // Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
3 // Copyright (C) 2012-2013 LunarG, Inc.
4 // Copyright (C) 2017 ARM Limited.
5 // Copyright (C) 2015-2019 Google, Inc.
6 // Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
8 // All rights reserved.
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions
14 // Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
17 // Redistributions in binary form must reproduce the above
18 // copyright notice, this list of conditions and the following
19 // disclaimer in the documentation and/or other materials provided
20 // with the distribution.
22 // Neither the name of 3Dlabs Inc. Ltd. nor the names of its
23 // contributors may be used to endorse or promote products derived
24 // from this software without specific prior written permission.
26 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
30 // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
31 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
32 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
33 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
36 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 // POSSIBILITY OF SUCH DAMAGE.
41 // Do not edit the .y file, only edit the .m4 file.
42 // The .y bison file is not a source file, it is a derivative of the .m4 file.
43 // The m4 file needs to be processed by m4 to generate the .y bison file.
45 // Code sandwiched between a pair:
47 // GLSLANG_WEB_EXCLUDE_ON
51 // GLSLANG_WEB_EXCLUDE_OFF
53 // Will be excluded from the grammar when m4 is executed as:
55 // m4 -P -DGLSLANG_WEB
57 // It will be included when m4 is executed as:
66 * This is bison grammar and productions for parsing all versions of the
67 * GLSL shading languages.
74 In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a
75 matching Lex specification) for the April 30, 1985 draft version of the
76 ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that
77 original, as mentioned in the answer to question 17.25 of the comp.lang.c
78 FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z.
80 I intend to keep this version as close to the current C Standard grammar as
81 possible; please let me know if you discover discrepancies.
86 #include "SymbolTable.h"
87 #include "ParseHelper.h"
88 #include "../Public/ShaderLang.h"
89 #include "attribute.h"
91 using namespace glslang;
95 %define parse.error verbose
99 glslang::TSourceLoc loc;
101 glslang::TString *string;
105 unsigned long long u64;
109 glslang::TSymbol* symbol;
112 glslang::TSourceLoc loc;
113 glslang::TOperator op;
115 TIntermNode* intermNode;
116 glslang::TIntermNodePair nodePair;
117 glslang::TIntermTyped* intermTypedNode;
118 glslang::TAttributes* attributes;
119 glslang::TSpirvRequirement* spirvReq;
120 glslang::TSpirvInstruction* spirvInst;
121 glslang::TSpirvTypeParameters* spirvTypeParams;
124 glslang::TPublicType type;
125 glslang::TFunction* function;
126 glslang::TParameter param;
127 glslang::TTypeLoc typeLine;
128 glslang::TTypeList* typeList;
129 glslang::TArraySizes* arraySizes;
130 glslang::TIdentifierList* identifierList;
132 glslang::TArraySizes* typeParameters;
138 /* windows only pragma */
140 #pragma warning(disable : 4065)
141 #pragma warning(disable : 4127)
142 #pragma warning(disable : 4244)
145 #define parseContext (*pParseContext)
146 #define yyerror(context, msg) context->parserError(msg)
148 extern int yylex(YYSTYPE*, TParseContext&);
152 %parse-param {glslang::TParseContext* pParseContext}
153 %lex-param {parseContext}
154 %pure-parser // enable thread safety
155 %expect 1 // One shift reduce conflict because of if | else
157 %token <lex> CONST BOOL INT UINT FLOAT
158 %token <lex> BVEC2 BVEC3 BVEC4
159 %token <lex> IVEC2 IVEC3 IVEC4
160 %token <lex> UVEC2 UVEC3 UVEC4
161 %token <lex> VEC2 VEC3 VEC4
162 %token <lex> MAT2 MAT3 MAT4
163 %token <lex> MAT2X2 MAT2X3 MAT2X4
164 %token <lex> MAT3X2 MAT3X3 MAT3X4
165 %token <lex> MAT4X2 MAT4X3 MAT4X4
167 // combined image/sampler
168 %token <lex> SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER2DSHADOW
169 %token <lex> SAMPLERCUBESHADOW SAMPLER2DARRAY
170 %token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
171 %token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
172 %token <lex> USAMPLERCUBE USAMPLER2DARRAY
174 // separate image/sampler
175 %token <lex> SAMPLER SAMPLERSHADOW
176 %token <lex> TEXTURE2D TEXTURE3D TEXTURECUBE TEXTURE2DARRAY
177 %token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
178 %token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
182 %token <lex> ATTRIBUTE VARYING
183 %token <lex> FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
184 %token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
185 %token <lex> I64VEC2 I64VEC3 I64VEC4
186 %token <lex> U64VEC2 U64VEC3 U64VEC4
187 %token <lex> I32VEC2 I32VEC3 I32VEC4
188 %token <lex> U32VEC2 U32VEC3 U32VEC4
189 %token <lex> I16VEC2 I16VEC3 I16VEC4
190 %token <lex> U16VEC2 U16VEC3 U16VEC4
191 %token <lex> I8VEC2 I8VEC3 I8VEC4
192 %token <lex> U8VEC2 U8VEC3 U8VEC4
193 %token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
194 %token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
195 %token <lex> F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4
196 %token <lex> F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4
197 %token <lex> DMAT2X2 DMAT2X3 DMAT2X4
198 %token <lex> DMAT3X2 DMAT3X3 DMAT3X4
199 %token <lex> DMAT4X2 DMAT4X3 DMAT4X4
200 %token <lex> F16MAT2X2 F16MAT2X3 F16MAT2X4
201 %token <lex> F16MAT3X2 F16MAT3X3 F16MAT3X4
202 %token <lex> F16MAT4X2 F16MAT4X3 F16MAT4X4
203 %token <lex> F32MAT2X2 F32MAT2X3 F32MAT2X4
204 %token <lex> F32MAT3X2 F32MAT3X3 F32MAT3X4
205 %token <lex> F32MAT4X2 F32MAT4X3 F32MAT4X4
206 %token <lex> F64MAT2X2 F64MAT2X3 F64MAT2X4
207 %token <lex> F64MAT3X2 F64MAT3X3 F64MAT3X4
208 %token <lex> F64MAT4X2 F64MAT4X3 F64MAT4X4
209 %token <lex> ATOMIC_UINT
210 %token <lex> ACCSTRUCTNV
211 %token <lex> ACCSTRUCTEXT
212 %token <lex> RAYQUERYEXT
213 %token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
214 %token <lex> HITOBJECTNV HITOBJECTATTRNV
216 // combined image/sampler
217 %token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
218 %token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
219 %token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
220 %token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
221 %token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
222 %token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
223 %token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY
224 %token <lex> SAMPLEREXTERNALOES
225 %token <lex> SAMPLEREXTERNAL2DY2YEXT
226 %token <lex> ISAMPLER1DARRAY USAMPLER1D USAMPLER1DARRAY
227 %token <lex> F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE
228 %token <lex> F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY
229 %token <lex> F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY
230 %token <lex> F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW
231 %token <lex> F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW
234 %token <lex> IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D
235 %token <lex> UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D
236 %token <lex> IMAGE2DRECT IIMAGE2DRECT UIMAGE2DRECT
237 %token <lex> IMAGECUBE IIMAGECUBE UIMAGECUBE
238 %token <lex> IMAGEBUFFER IIMAGEBUFFER UIMAGEBUFFER
239 %token <lex> IMAGE1DARRAY IIMAGE1DARRAY UIMAGE1DARRAY
240 %token <lex> IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY
241 %token <lex> IMAGECUBEARRAY IIMAGECUBEARRAY UIMAGECUBEARRAY
242 %token <lex> IMAGE2DMS IIMAGE2DMS UIMAGE2DMS
243 %token <lex> IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY
245 %token <lex> F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT
246 %token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
247 %token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
249 %token <lex> I64IMAGE1D U64IMAGE1D
250 %token <lex> I64IMAGE2D U64IMAGE2D
251 %token <lex> I64IMAGE3D U64IMAGE3D
252 %token <lex> I64IMAGE2DRECT U64IMAGE2DRECT
253 %token <lex> I64IMAGECUBE U64IMAGECUBE
254 %token <lex> I64IMAGEBUFFER U64IMAGEBUFFER
255 %token <lex> I64IMAGE1DARRAY U64IMAGE1DARRAY
256 %token <lex> I64IMAGE2DARRAY U64IMAGE2DARRAY
257 %token <lex> I64IMAGECUBEARRAY U64IMAGECUBEARRAY
258 %token <lex> I64IMAGE2DMS U64IMAGE2DMS
259 %token <lex> I64IMAGE2DMSARRAY U64IMAGE2DMSARRAY
261 // texture without sampler
262 %token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
263 %token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
264 %token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
265 %token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
266 %token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
267 %token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
268 %token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
270 %token <lex> F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE
271 %token <lex> F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY
272 %token <lex> F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY
275 %token <lex> SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS
276 %token <lex> F16SUBPASSINPUT F16SUBPASSINPUTMS
279 %token <lex> SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID
280 %token <lex> SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING
281 %token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
285 %token <lex> LEFT_OP RIGHT_OP
286 %token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
287 %token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
288 %token <lex> MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
289 %token <lex> SUB_ASSIGN
290 %token <lex> STRING_LITERAL
292 %token <lex> LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT
293 %token <lex> COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT
294 %token <lex> LEFT_ANGLE RIGHT_ANGLE VERTICAL_BAR CARET AMPERSAND QUESTION
296 %token <lex> INVARIANT
297 %token <lex> HIGH_PRECISION MEDIUM_PRECISION LOW_PRECISION PRECISION
298 %token <lex> PACKED RESOURCE SUPERP
300 %token <lex> FLOATCONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
301 %token <lex> IDENTIFIER TYPE_NAME
302 %token <lex> CENTROID IN OUT INOUT
303 %token <lex> STRUCT VOID WHILE
304 %token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
305 %token <lex> TERMINATE_INVOCATION
306 %token <lex> TERMINATE_RAY IGNORE_INTERSECTION
307 %token <lex> UNIFORM SHARED BUFFER
308 %token <lex> FLAT SMOOTH LAYOUT
311 %token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
312 %token <lex> INT64CONSTANT UINT64CONSTANT
313 %token <lex> SUBROUTINE DEMOTE
314 %token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
315 %token <lex> PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT
316 %token <lex> PATCH SAMPLE NONUNIFORM
317 %token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
318 %token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
319 %token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
323 %type <interm> assignment_operator unary_operator
324 %type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
325 %type <interm.intermTypedNode> expression integer_expression assignment_expression
326 %type <interm.intermTypedNode> unary_expression multiplicative_expression additive_expression
327 %type <interm.intermTypedNode> relational_expression equality_expression
328 %type <interm.intermTypedNode> conditional_expression constant_expression
329 %type <interm.intermTypedNode> logical_or_expression logical_xor_expression logical_and_expression
330 %type <interm.intermTypedNode> shift_expression and_expression exclusive_or_expression inclusive_or_expression
331 %type <interm.intermTypedNode> function_call initializer condition conditionopt
333 %type <interm.intermNode> translation_unit function_definition
334 %type <interm.intermNode> statement simple_statement
335 %type <interm.intermNode> statement_list switch_statement_list compound_statement
336 %type <interm.intermNode> declaration_statement selection_statement selection_statement_nonattributed expression_statement
337 %type <interm.intermNode> switch_statement switch_statement_nonattributed case_label
338 %type <interm.intermNode> declaration external_declaration
339 %type <interm.intermNode> for_init_statement compound_statement_no_new_scope
340 %type <interm.nodePair> selection_rest_statement for_rest_statement
341 %type <interm.intermNode> iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped
342 %type <interm> single_declaration init_declarator_list
344 %type <interm> parameter_declaration parameter_declarator parameter_type_specifier
346 %type <interm> array_specifier
347 %type <interm.type> invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier
348 %type <interm.type> layout_qualifier layout_qualifier_id_list layout_qualifier_id
350 %type <interm.typeParameters> type_parameter_specifier
351 %type <interm.typeParameters> type_parameter_specifier_opt
352 %type <interm.typeParameters> type_parameter_specifier_list
354 %type <interm.type> type_qualifier fully_specified_type type_specifier
355 %type <interm.type> single_type_qualifier
356 %type <interm.type> type_specifier_nonarray
357 %type <interm.type> struct_specifier
358 %type <interm.typeLine> struct_declarator
359 %type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list
360 %type <interm> block_structure
361 %type <interm.function> function_header function_declarator
362 %type <interm.function> function_header_with_parameters
363 %type <interm> function_call_header_with_parameters function_call_header_no_parameters function_call_generic function_prototype
364 %type <interm> function_call_or_method function_identifier function_call_header
366 %type <interm.identifierList> identifier_list
369 %type <interm.type> precise_qualifier non_uniform_qualifier
370 %type <interm.typeList> type_name_list
371 %type <interm.attributes> attribute attribute_list single_attribute
372 %type <interm.intermNode> demote_statement
373 %type <interm.intermTypedNode> initializer_list
374 %type <interm.spirvReq> spirv_requirements_list spirv_requirements_parameter
375 %type <interm.intermNode> spirv_extension_list spirv_capability_list
376 %type <interm.intermNode> spirv_execution_mode_qualifier
377 %type <interm.intermNode> spirv_execution_mode_parameter_list spirv_execution_mode_parameter spirv_execution_mode_id_parameter_list
378 %type <interm.type> spirv_storage_class_qualifier
379 %type <interm.type> spirv_decorate_qualifier
380 %type <interm.intermNode> spirv_decorate_parameter_list spirv_decorate_parameter
381 %type <interm.intermNode> spirv_decorate_id_parameter_list
382 %type <interm.intermNode> spirv_decorate_string_parameter_list
383 %type <interm.type> spirv_type_specifier
384 %type <interm.spirvTypeParams> spirv_type_parameter_list spirv_type_parameter
385 %type <interm.spirvInst> spirv_instruction_qualifier
386 %type <interm.spirvInst> spirv_instruction_qualifier_list spirv_instruction_qualifier_id
389 %start translation_unit
394 $$ = parseContext.handleVariable($1.loc, $1.symbol, $1.string);
399 : variable_identifier {
402 | LEFT_PAREN expression RIGHT_PAREN {
404 if ($$->getAsConstantUnion())
405 $$->getAsConstantUnion()->setExpression();
408 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
411 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
414 parseContext.fullIntegerCheck($1.loc, "unsigned literal");
415 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
418 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
422 $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
425 parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
426 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
429 parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
430 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
433 parseContext.int64Check($1.loc, "64-bit integer literal");
434 $$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true);
437 parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
438 $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
441 parseContext.explicitInt16Check($1.loc, "16-bit integer literal");
442 $$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true);
445 parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal");
446 $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
449 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal");
450 if (! parseContext.symbolTable.atBuiltInLevel())
451 parseContext.doubleCheck($1.loc, "double literal");
452 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
455 parseContext.float16Check($1.loc, "half float literal");
456 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
462 : primary_expression {
465 | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET {
466 $$ = parseContext.handleBracketDereference($2.loc, $1, $3);
471 | postfix_expression DOT IDENTIFIER {
472 $$ = parseContext.handleDotDereference($3.loc, $1, *$3.string);
474 | postfix_expression INC_OP {
475 parseContext.variableCheck($1);
476 parseContext.lValueErrorCheck($2.loc, "++", $1);
477 $$ = parseContext.handleUnaryMath($2.loc, "++", EOpPostIncrement, $1);
479 | postfix_expression DEC_OP {
480 parseContext.variableCheck($1);
481 parseContext.lValueErrorCheck($2.loc, "--", $1);
482 $$ = parseContext.handleUnaryMath($2.loc, "--", EOpPostDecrement, $1);
488 parseContext.integerCheck($1, "[]");
494 : function_call_or_method {
495 $$ = parseContext.handleFunctionCall($1.loc, $1.function, $1.intermNode);
500 function_call_or_method
501 : function_call_generic {
506 function_call_generic
507 : function_call_header_with_parameters RIGHT_PAREN {
511 | function_call_header_no_parameters RIGHT_PAREN {
517 function_call_header_no_parameters
518 : function_call_header VOID {
521 | function_call_header {
526 function_call_header_with_parameters
527 : function_call_header assignment_expression {
528 TParameter param = { 0, new TType };
529 param.type->shallowCopy($2->getType());
530 $1.function->addParameter(param);
531 $$.function = $1.function;
534 | function_call_header_with_parameters COMMA assignment_expression {
535 TParameter param = { 0, new TType };
536 param.type->shallowCopy($3->getType());
537 $1.function->addParameter(param);
538 $$.function = $1.function;
539 $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc);
544 : function_identifier LEFT_PAREN {
549 // Grammar Note: Constructors look like functions, but are recognized as types.
555 $$.function = parseContext.handleConstructorCall($1.loc, $1);
557 | postfix_expression {
559 // Should be a method or subroutine call, but we haven't recognized the arguments yet.
564 TIntermMethod* method = $1->getAsMethodNode();
566 $$.function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength);
567 $$.intermNode = method->getObject();
569 TIntermSymbol* symbol = $1->getAsSymbolNode();
571 parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName());
572 TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid));
573 $$.function = function;
575 parseContext.error($1->getLoc(), "function call, method, or subroutine call expected", "", "");
578 if ($$.function == 0) {
580 TString* empty = NewPoolTString("");
581 $$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
585 | non_uniform_qualifier {
588 $$.function = parseContext.handleConstructorCall($1.loc, $1);
594 : postfix_expression {
595 parseContext.variableCheck($1);
597 if (TIntermMethod* method = $1->getAsMethodNode())
598 parseContext.error($1->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), "");
600 | INC_OP unary_expression {
601 parseContext.lValueErrorCheck($1.loc, "++", $2);
602 $$ = parseContext.handleUnaryMath($1.loc, "++", EOpPreIncrement, $2);
604 | DEC_OP unary_expression {
605 parseContext.lValueErrorCheck($1.loc, "--", $2);
606 $$ = parseContext.handleUnaryMath($1.loc, "--", EOpPreDecrement, $2);
608 | unary_operator unary_expression {
609 if ($1.op != EOpNull) {
610 char errorOp[2] = {0, 0};
612 case EOpNegative: errorOp[0] = '-'; break;
613 case EOpLogicalNot: errorOp[0] = '!'; break;
614 case EOpBitwiseNot: errorOp[0] = '~'; break;
615 default: break; // some compilers want this
617 $$ = parseContext.handleUnaryMath($1.loc, errorOp, $1.op, $2);
620 if ($$->getAsConstantUnion())
621 $$->getAsConstantUnion()->setExpression();
625 // Grammar Note: No traditional style type casts.
628 : PLUS { $$.loc = $1.loc; $$.op = EOpNull; }
629 | DASH { $$.loc = $1.loc; $$.op = EOpNegative; }
630 | BANG { $$.loc = $1.loc; $$.op = EOpLogicalNot; }
631 | TILDE { $$.loc = $1.loc; $$.op = EOpBitwiseNot;
632 parseContext.fullIntegerCheck($1.loc, "bitwise not"); }
634 // Grammar Note: No '*' or '&' unary ops. Pointers are not supported.
636 multiplicative_expression
637 : unary_expression { $$ = $1; }
638 | multiplicative_expression STAR unary_expression {
639 $$ = parseContext.handleBinaryMath($2.loc, "*", EOpMul, $1, $3);
643 | multiplicative_expression SLASH unary_expression {
644 $$ = parseContext.handleBinaryMath($2.loc, "/", EOpDiv, $1, $3);
648 | multiplicative_expression PERCENT unary_expression {
649 parseContext.fullIntegerCheck($2.loc, "%");
650 $$ = parseContext.handleBinaryMath($2.loc, "%", EOpMod, $1, $3);
657 : multiplicative_expression { $$ = $1; }
658 | additive_expression PLUS multiplicative_expression {
659 $$ = parseContext.handleBinaryMath($2.loc, "+", EOpAdd, $1, $3);
663 | additive_expression DASH multiplicative_expression {
664 $$ = parseContext.handleBinaryMath($2.loc, "-", EOpSub, $1, $3);
671 : additive_expression { $$ = $1; }
672 | shift_expression LEFT_OP additive_expression {
673 parseContext.fullIntegerCheck($2.loc, "bit shift left");
674 $$ = parseContext.handleBinaryMath($2.loc, "<<", EOpLeftShift, $1, $3);
678 | shift_expression RIGHT_OP additive_expression {
679 parseContext.fullIntegerCheck($2.loc, "bit shift right");
680 $$ = parseContext.handleBinaryMath($2.loc, ">>", EOpRightShift, $1, $3);
686 relational_expression
687 : shift_expression { $$ = $1; }
688 | relational_expression LEFT_ANGLE shift_expression {
689 $$ = parseContext.handleBinaryMath($2.loc, "<", EOpLessThan, $1, $3);
691 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
693 | relational_expression RIGHT_ANGLE shift_expression {
694 $$ = parseContext.handleBinaryMath($2.loc, ">", EOpGreaterThan, $1, $3);
696 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
698 | relational_expression LE_OP shift_expression {
699 $$ = parseContext.handleBinaryMath($2.loc, "<=", EOpLessThanEqual, $1, $3);
701 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
703 | relational_expression GE_OP shift_expression {
704 $$ = parseContext.handleBinaryMath($2.loc, ">=", EOpGreaterThanEqual, $1, $3);
706 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
711 : relational_expression { $$ = $1; }
712 | equality_expression EQ_OP relational_expression {
713 parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison");
714 parseContext.opaqueCheck($2.loc, $1->getType(), "==");
715 parseContext.specializationCheck($2.loc, $1->getType(), "==");
716 parseContext.referenceCheck($2.loc, $1->getType(), "==");
717 $$ = parseContext.handleBinaryMath($2.loc, "==", EOpEqual, $1, $3);
719 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
721 | equality_expression NE_OP relational_expression {
722 parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison");
723 parseContext.opaqueCheck($2.loc, $1->getType(), "!=");
724 parseContext.specializationCheck($2.loc, $1->getType(), "!=");
725 parseContext.referenceCheck($2.loc, $1->getType(), "!=");
726 $$ = parseContext.handleBinaryMath($2.loc, "!=", EOpNotEqual, $1, $3);
728 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
733 : equality_expression { $$ = $1; }
734 | and_expression AMPERSAND equality_expression {
735 parseContext.fullIntegerCheck($2.loc, "bitwise and");
736 $$ = parseContext.handleBinaryMath($2.loc, "&", EOpAnd, $1, $3);
742 exclusive_or_expression
743 : and_expression { $$ = $1; }
744 | exclusive_or_expression CARET and_expression {
745 parseContext.fullIntegerCheck($2.loc, "bitwise exclusive or");
746 $$ = parseContext.handleBinaryMath($2.loc, "^", EOpExclusiveOr, $1, $3);
752 inclusive_or_expression
753 : exclusive_or_expression { $$ = $1; }
754 | inclusive_or_expression VERTICAL_BAR exclusive_or_expression {
755 parseContext.fullIntegerCheck($2.loc, "bitwise inclusive or");
756 $$ = parseContext.handleBinaryMath($2.loc, "|", EOpInclusiveOr, $1, $3);
762 logical_and_expression
763 : inclusive_or_expression { $$ = $1; }
764 | logical_and_expression AND_OP inclusive_or_expression {
765 $$ = parseContext.handleBinaryMath($2.loc, "&&", EOpLogicalAnd, $1, $3);
767 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
771 logical_xor_expression
772 : logical_and_expression { $$ = $1; }
773 | logical_xor_expression XOR_OP logical_and_expression {
774 $$ = parseContext.handleBinaryMath($2.loc, "^^", EOpLogicalXor, $1, $3);
776 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
780 logical_or_expression
781 : logical_xor_expression { $$ = $1; }
782 | logical_or_expression OR_OP logical_xor_expression {
783 $$ = parseContext.handleBinaryMath($2.loc, "||", EOpLogicalOr, $1, $3);
785 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
789 conditional_expression
790 : logical_or_expression { $$ = $1; }
791 | logical_or_expression QUESTION {
792 ++parseContext.controlFlowNestingLevel;
794 expression COLON assignment_expression {
795 --parseContext.controlFlowNestingLevel;
796 parseContext.boolCheck($2.loc, $1);
797 parseContext.rValueErrorCheck($2.loc, "?", $1);
798 parseContext.rValueErrorCheck($5.loc, ":", $4);
799 parseContext.rValueErrorCheck($5.loc, ":", $6);
800 $$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc);
802 parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $6->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
808 assignment_expression
809 : conditional_expression { $$ = $1; }
810 | unary_expression assignment_operator assignment_expression {
811 parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment");
812 parseContext.opaqueCheck($2.loc, $1->getType(), "=");
813 parseContext.storage16BitAssignmentCheck($2.loc, $1->getType(), "=");
814 parseContext.specializationCheck($2.loc, $1->getType(), "=");
815 parseContext.lValueErrorCheck($2.loc, "assign", $1);
816 parseContext.rValueErrorCheck($2.loc, "assign", $3);
817 $$ = parseContext.addAssign($2.loc, $2.op, $1, $3);
819 parseContext.assignError($2.loc, "assign", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
832 $$.op = EOpMulAssign;
836 $$.op = EOpDivAssign;
839 parseContext.fullIntegerCheck($1.loc, "%=");
841 $$.op = EOpModAssign;
845 $$.op = EOpAddAssign;
849 $$.op = EOpSubAssign;
852 parseContext.fullIntegerCheck($1.loc, "bit-shift left assign");
853 $$.loc = $1.loc; $$.op = EOpLeftShiftAssign;
856 parseContext.fullIntegerCheck($1.loc, "bit-shift right assign");
857 $$.loc = $1.loc; $$.op = EOpRightShiftAssign;
860 parseContext.fullIntegerCheck($1.loc, "bitwise-and assign");
861 $$.loc = $1.loc; $$.op = EOpAndAssign;
864 parseContext.fullIntegerCheck($1.loc, "bitwise-xor assign");
865 $$.loc = $1.loc; $$.op = EOpExclusiveOrAssign;
868 parseContext.fullIntegerCheck($1.loc, "bitwise-or assign");
869 $$.loc = $1.loc; $$.op = EOpInclusiveOrAssign;
874 : assignment_expression {
877 | expression COMMA assignment_expression {
878 parseContext.samplerConstructorLocationCheck($2.loc, ",", $3);
879 $$ = parseContext.intermediate.addComma($1, $3, $2.loc);
881 parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
888 : conditional_expression {
889 parseContext.constantValueCheck($1, "");
895 : function_prototype SEMICOLON {
896 parseContext.handleFunctionDeclarator($1.loc, *$1.function, true /* prototype */);
898 // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
901 | spirv_instruction_qualifier function_prototype SEMICOLON {
902 parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
903 $2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier
904 parseContext.handleFunctionDeclarator($2.loc, *$2.function, true /* prototype */);
906 // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
908 | spirv_execution_mode_qualifier SEMICOLON {
909 parseContext.globalCheck($2.loc, "SPIR-V execution mode qualifier");
910 parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
914 | init_declarator_list SEMICOLON {
915 if ($1.intermNode && $1.intermNode->getAsAggregate())
916 $1.intermNode->getAsAggregate()->setOperator(EOpSequence);
919 | PRECISION precision_qualifier type_specifier SEMICOLON {
920 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "precision statement");
921 // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope
922 parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]);
923 parseContext.setDefaultPrecision($1.loc, $3, $2.qualifier.precision);
926 | block_structure SEMICOLON {
927 parseContext.declareBlock($1.loc, *$1.typeList);
930 | block_structure IDENTIFIER SEMICOLON {
931 parseContext.declareBlock($1.loc, *$1.typeList, $2.string);
934 | block_structure IDENTIFIER array_specifier SEMICOLON {
935 parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes);
938 | type_qualifier SEMICOLON {
939 parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
940 parseContext.updateStandaloneQualifierDefaults($1.loc, $1);
943 | type_qualifier IDENTIFIER SEMICOLON {
944 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
945 parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$2.string);
948 | type_qualifier IDENTIFIER identifier_list SEMICOLON {
949 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
950 $3->push_back($2.string);
951 parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$3);
957 : type_qualifier IDENTIFIER LEFT_BRACE { parseContext.nestedBlockCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
958 --parseContext.blockNestingLevel;
959 parseContext.blockName = $2.string;
960 parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
961 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
962 parseContext.currentBlockQualifier = $1.qualifier;
969 $$ = new TIdentifierList;
970 $$->push_back($2.string);
972 | identifier_list COMMA IDENTIFIER {
974 $$->push_back($3.string);
979 : function_declarator RIGHT_PAREN {
983 | function_declarator RIGHT_PAREN attribute {
986 parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
987 parseContext.handleFunctionAttributes($2.loc, *$3);
989 | attribute function_declarator RIGHT_PAREN {
992 parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
993 parseContext.handleFunctionAttributes($3.loc, *$1);
995 | attribute function_declarator RIGHT_PAREN attribute {
998 parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
999 parseContext.handleFunctionAttributes($3.loc, *$1);
1000 parseContext.handleFunctionAttributes($3.loc, *$4);
1008 | function_header_with_parameters {
1014 function_header_with_parameters
1015 : function_header parameter_declaration {
1016 // Add the parameter
1018 if ($2.param.type->getBasicType() != EbtVoid)
1019 $1->addParameter($2.param);
1021 delete $2.param.type;
1023 | function_header_with_parameters COMMA parameter_declaration {
1025 // Only first parameter of one-parameter functions can be void
1026 // The check for named parameters not being void is done in parameter_declarator
1028 if ($3.param.type->getBasicType() == EbtVoid) {
1030 // This parameter > first is void
1032 parseContext.error($2.loc, "cannot be an argument type except for '(void)'", "void", "");
1033 delete $3.param.type;
1035 // Add the parameter
1037 $1->addParameter($3.param);
1043 : fully_specified_type IDENTIFIER LEFT_PAREN {
1044 if ($1.qualifier.storage != EvqGlobal && $1.qualifier.storage != EvqTemporary) {
1045 parseContext.error($2.loc, "no qualifiers allowed for function return",
1046 GetStorageQualifierString($1.qualifier.storage), "");
1049 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1051 // Add the function as a prototype after parsing it (we do not support recursion)
1052 TFunction *function;
1055 // Potentially rename shader entry point function. No-op most of the time.
1056 parseContext.renameShaderFunction($2.string);
1058 // Make the function
1059 function = new TFunction($2.string, type);
1064 parameter_declarator
1066 : type_specifier IDENTIFIER {
1067 if ($1.arraySizes) {
1068 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1069 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
1070 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1072 if ($1.basicType == EbtVoid) {
1073 parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), "");
1075 parseContext.reservedErrorCheck($2.loc, *$2.string);
1077 TParameter param = {$2.string, new TType($1)};
1081 | type_specifier IDENTIFIER array_specifier {
1082 if ($1.arraySizes) {
1083 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1084 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
1085 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1087 TType* type = new TType($1);
1088 type->transferArraySizes($3.arraySizes);
1089 type->copyArrayInnerSizes($1.arraySizes);
1091 parseContext.arrayOfArrayVersionCheck($2.loc, type->getArraySizes());
1092 parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes);
1093 parseContext.reservedErrorCheck($2.loc, *$2.string);
1095 TParameter param = { $2.string, type };
1102 parameter_declaration
1106 : type_qualifier parameter_declarator {
1108 if ($1.qualifier.precision != EpqNone)
1109 $$.param.type->getQualifier().precision = $1.qualifier.precision;
1110 parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1112 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
1113 parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
1114 parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type);
1117 | parameter_declarator {
1120 parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
1121 parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
1122 parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1127 | type_qualifier parameter_type_specifier {
1129 if ($1.qualifier.precision != EpqNone)
1130 $$.param.type->getQualifier().precision = $1.qualifier.precision;
1131 parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1133 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
1134 parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
1135 parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type);
1137 | parameter_type_specifier {
1140 parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
1141 parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
1142 parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1146 parameter_type_specifier
1148 TParameter param = { 0, new TType($1) };
1151 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1155 init_declarator_list
1156 : single_declaration {
1159 | init_declarator_list COMMA IDENTIFIER {
1161 parseContext.declareVariable($3.loc, *$3.string, $1.type);
1163 | init_declarator_list COMMA IDENTIFIER array_specifier {
1165 parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes);
1167 | init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer {
1169 TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6);
1170 $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $5.loc);
1172 | init_declarator_list COMMA IDENTIFIER EQUAL initializer {
1174 TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5);
1175 $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $4.loc);
1180 : fully_specified_type {
1184 parseContext.declareTypeDefaults($$.loc, $$.type);
1187 | fully_specified_type IDENTIFIER {
1190 parseContext.declareVariable($2.loc, *$2.string, $1);
1192 | fully_specified_type IDENTIFIER array_specifier {
1195 parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes);
1197 | fully_specified_type IDENTIFIER array_specifier EQUAL initializer {
1199 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5);
1200 $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $4.loc);
1202 | fully_specified_type IDENTIFIER EQUAL initializer {
1204 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
1205 $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $3.loc);
1208 // Grammar Note: No 'enum', or 'typedef'.
1210 fully_specified_type
1214 parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $$);
1215 if ($1.arraySizes) {
1216 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1217 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
1219 parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
1221 | type_qualifier type_specifier {
1222 parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
1223 parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2);
1225 if ($2.arraySizes) {
1226 parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1227 parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
1230 if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier))
1231 $2.arraySizes = nullptr;
1233 parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
1234 $2.shaderQualifiers.merge($1.shaderQualifiers);
1235 parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
1236 parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
1240 if (! $$.qualifier.isInterpolation() &&
1241 ((parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut) ||
1242 (parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn)))
1243 $$.qualifier.smooth = true;
1249 parseContext.globalCheck($1.loc, "invariant");
1250 parseContext.profileRequires($$.loc, ENoProfile, 120, 0, "invariant");
1252 $$.qualifier.invariant = true;
1256 interpolation_qualifier
1258 parseContext.globalCheck($1.loc, "smooth");
1259 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "smooth");
1260 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "smooth");
1262 $$.qualifier.smooth = true;
1265 parseContext.globalCheck($1.loc, "flat");
1266 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "flat");
1267 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "flat");
1269 $$.qualifier.flat = true;
1273 parseContext.globalCheck($1.loc, "noperspective");
1274 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
1275 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective");
1277 $$.qualifier.nopersp = true;
1279 | EXPLICITINTERPAMD {
1280 parseContext.globalCheck($1.loc, "__explicitInterpAMD");
1281 parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
1282 parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
1284 $$.qualifier.explicitInterp = true;
1287 parseContext.globalCheck($1.loc, "pervertexNV");
1288 parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
1289 parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
1290 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
1292 $$.qualifier.pervertexNV = true;
1295 parseContext.globalCheck($1.loc, "pervertexEXT");
1296 parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
1297 parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
1298 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
1300 $$.qualifier.pervertexEXT = true;
1303 // No need for profile version or extension check. Shader stage already checks both.
1304 parseContext.globalCheck($1.loc, "perprimitiveNV");
1305 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV");
1306 // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
1307 if (parseContext.language == EShLangFragment)
1308 parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
1310 $$.qualifier.perPrimitiveNV = true;
1313 // No need for profile version or extension check. Shader stage already checks both.
1314 parseContext.globalCheck($1.loc, "perprimitiveEXT");
1315 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT");
1316 // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
1317 if (parseContext.language == EShLangFragment)
1318 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT");
1320 $$.qualifier.perPrimitiveNV = true;
1323 // No need for profile version or extension check. Shader stage already checks both.
1324 parseContext.globalCheck($1.loc, "perviewNV");
1325 parseContext.requireStage($1.loc, EShLangMesh, "perviewNV");
1327 $$.qualifier.perViewNV = true;
1330 // No need for profile version or extension check. Shader stage already checks both.
1331 parseContext.globalCheck($1.loc, "taskNV");
1332 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV");
1334 $$.qualifier.perTaskNV = true;
1340 : LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN {
1345 layout_qualifier_id_list
1346 : layout_qualifier_id {
1349 | layout_qualifier_id_list COMMA layout_qualifier_id {
1351 $$.shaderQualifiers.merge($3.shaderQualifiers);
1352 parseContext.mergeObjectLayoutQualifiers($$.qualifier, $3.qualifier, false);
1358 parseContext.setLayoutQualifier($1.loc, $$, *$1.string);
1360 | IDENTIFIER EQUAL constant_expression {
1362 parseContext.setLayoutQualifier($1.loc, $$, *$1.string, $3);
1364 | SHARED { // because "shared" is both an identifier and a keyword
1366 TString strShared("shared");
1367 parseContext.setLayoutQualifier($1.loc, $$, strShared);
1374 parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
1375 parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise");
1377 $$.qualifier.noContraction = true;
1383 : single_type_qualifier {
1386 | type_qualifier single_type_qualifier {
1388 if ($$.basicType == EbtVoid)
1389 $$.basicType = $2.basicType;
1391 $$.shaderQualifiers.merge($2.shaderQualifiers);
1392 parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false);
1396 single_type_qualifier
1397 : storage_qualifier {
1400 | layout_qualifier {
1403 | precision_qualifier {
1404 parseContext.checkPrecisionQualifier($1.loc, $1.qualifier.precision);
1407 | interpolation_qualifier {
1408 // allow inheritance of storage qualifier from block declaration
1411 | invariant_qualifier {
1412 // allow inheritance of storage qualifier from block declaration
1416 | precise_qualifier {
1417 // allow inheritance of storage qualifier from block declaration
1420 | non_uniform_qualifier {
1423 | spirv_storage_class_qualifier {
1424 parseContext.globalCheck($1.loc, "spirv_storage_class");
1425 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier");
1428 | spirv_decorate_qualifier {
1429 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier");
1432 | SPIRV_BY_REFERENCE {
1433 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference");
1435 $$.qualifier.setSpirvByReference();
1438 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal");
1440 $$.qualifier.setSpirvLiteral();
1448 $$.qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant
1451 parseContext.globalCheck($1.loc, "inout");
1453 $$.qualifier.storage = EvqInOut;
1456 parseContext.globalCheck($1.loc, "in");
1458 // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later
1459 $$.qualifier.storage = EvqIn;
1462 parseContext.globalCheck($1.loc, "out");
1464 // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later
1465 $$.qualifier.storage = EvqOut;
1468 parseContext.profileRequires($1.loc, ENoProfile, 120, 0, "centroid");
1469 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "centroid");
1470 parseContext.globalCheck($1.loc, "centroid");
1472 $$.qualifier.centroid = true;
1475 parseContext.globalCheck($1.loc, "uniform");
1477 $$.qualifier.storage = EvqUniform;
1480 parseContext.globalCheck($1.loc, "shared");
1481 parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
1482 parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
1483 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
1485 $$.qualifier.storage = EvqShared;
1488 parseContext.globalCheck($1.loc, "buffer");
1490 $$.qualifier.storage = EvqBuffer;
1494 parseContext.requireStage($1.loc, EShLangVertex, "attribute");
1495 parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
1496 parseContext.checkDeprecated($1.loc, ENoProfile, 130, "attribute");
1497 parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "attribute");
1498 parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "attribute");
1500 parseContext.globalCheck($1.loc, "attribute");
1503 $$.qualifier.storage = EvqVaryingIn;
1506 parseContext.checkDeprecated($1.loc, ENoProfile, 130, "varying");
1507 parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "varying");
1508 parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "varying");
1509 parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "varying");
1511 parseContext.globalCheck($1.loc, "varying");
1514 if (parseContext.language == EShLangVertex)
1515 $$.qualifier.storage = EvqVaryingOut;
1517 $$.qualifier.storage = EvqVaryingIn;
1520 parseContext.globalCheck($1.loc, "patch");
1521 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch");
1523 $$.qualifier.patch = true;
1526 parseContext.globalCheck($1.loc, "sample");
1528 $$.qualifier.sample = true;
1531 parseContext.globalCheck($1.loc, "hitAttributeNV");
1532 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
1533 | EShLangAnyHitMask), "hitAttributeNV");
1534 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV");
1536 $$.qualifier.storage = EvqHitAttr;
1539 parseContext.globalCheck($1.loc, "hitAttributeNV");
1540 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask
1541 | EShLangMissMask), "hitObjectAttributeNV");
1542 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV");
1544 $$.qualifier.storage = EvqHitObjectAttrNV;
1547 parseContext.globalCheck($1.loc, "hitAttributeEXT");
1548 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
1549 | EShLangAnyHitMask), "hitAttributeEXT");
1550 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV");
1552 $$.qualifier.storage = EvqHitAttr;
1555 parseContext.globalCheck($1.loc, "rayPayloadNV");
1556 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
1557 EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV");
1558 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV");
1560 $$.qualifier.storage = EvqPayload;
1563 parseContext.globalCheck($1.loc, "rayPayloadEXT");
1564 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
1565 EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT");
1566 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT");
1568 $$.qualifier.storage = EvqPayload;
1571 parseContext.globalCheck($1.loc, "rayPayloadInNV");
1572 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
1573 EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV");
1574 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV");
1576 $$.qualifier.storage = EvqPayloadIn;
1579 parseContext.globalCheck($1.loc, "rayPayloadInEXT");
1580 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
1581 EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT");
1582 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT");
1584 $$.qualifier.storage = EvqPayloadIn;
1587 parseContext.globalCheck($1.loc, "callableDataNV");
1588 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
1589 EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV");
1590 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV");
1592 $$.qualifier.storage = EvqCallableData;
1595 parseContext.globalCheck($1.loc, "callableDataEXT");
1596 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
1597 EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT");
1598 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT");
1600 $$.qualifier.storage = EvqCallableData;
1603 parseContext.globalCheck($1.loc, "callableDataInNV");
1604 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV");
1605 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV");
1607 $$.qualifier.storage = EvqCallableDataIn;
1610 parseContext.globalCheck($1.loc, "callableDataInEXT");
1611 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT");
1612 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT");
1614 $$.qualifier.storage = EvqCallableDataIn;
1618 $$.qualifier.coherent = true;
1622 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent");
1623 $$.qualifier.devicecoherent = true;
1625 | QUEUEFAMILYCOHERENT {
1627 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent");
1628 $$.qualifier.queuefamilycoherent = true;
1630 | WORKGROUPCOHERENT {
1632 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent");
1633 $$.qualifier.workgroupcoherent = true;
1635 | SUBGROUPCOHERENT {
1637 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent");
1638 $$.qualifier.subgroupcoherent = true;
1642 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate");
1643 $$.qualifier.nonprivate = true;
1645 | SHADERCALLCOHERENT {
1647 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent");
1648 $$.qualifier.shadercallcoherent = true;
1652 $$.qualifier.volatil = true;
1656 $$.qualifier.restrict = true;
1660 $$.qualifier.readonly = true;
1664 $$.qualifier.writeonly = true;
1667 parseContext.spvRemoved($1.loc, "subroutine");
1668 parseContext.globalCheck($1.loc, "subroutine");
1669 parseContext.unimplemented($1.loc, "subroutine");
1672 | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN {
1673 parseContext.spvRemoved($1.loc, "subroutine");
1674 parseContext.globalCheck($1.loc, "subroutine");
1675 parseContext.unimplemented($1.loc, "subroutine");
1678 | TASKPAYLOADWORKGROUPEXT {
1679 // No need for profile version or extension check. Shader stage already checks both.
1680 parseContext.globalCheck($1.loc, "taskPayloadSharedEXT");
1681 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT ");
1683 $$.qualifier.storage = EvqtaskPayloadSharedEXT;
1689 non_uniform_qualifier
1692 $$.qualifier.nonUniform = true;
1700 | type_name_list COMMA IDENTIFIER {
1701 // TODO: 4.0 semantics: subroutines
1702 // 1) make sure each identifier is a type declared earlier with SUBROUTINE
1703 // 2) save all of the identifiers for future comparison with the declared function
1709 : type_specifier_nonarray type_parameter_specifier_opt {
1711 $$.qualifier.precision = parseContext.getDefaultPrecision($$);
1712 $$.typeParameters = $2;
1714 | type_specifier_nonarray type_parameter_specifier_opt array_specifier {
1715 parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
1717 $$.qualifier.precision = parseContext.getDefaultPrecision($$);
1718 $$.typeParameters = $2;
1719 $$.arraySizes = $3.arraySizes;
1724 : LEFT_BRACKET RIGHT_BRACKET {
1726 $$.arraySizes = new TArraySizes;
1727 $$.arraySizes->addInnerSize();
1729 | LEFT_BRACKET conditional_expression RIGHT_BRACKET {
1731 $$.arraySizes = new TArraySizes;
1734 parseContext.arraySizeCheck($2->getLoc(), $2, size, "array size");
1735 $$.arraySizes->addInnerSize(size);
1737 | array_specifier LEFT_BRACKET RIGHT_BRACKET {
1739 $$.arraySizes->addInnerSize();
1741 | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET {
1745 parseContext.arraySizeCheck($3->getLoc(), $3, size, "array size");
1746 $$.arraySizes->addInnerSize(size);
1750 type_parameter_specifier_opt
1751 : type_parameter_specifier {
1754 | /* May be null */ {
1759 type_parameter_specifier
1760 : LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE {
1765 type_parameter_specifier_list
1766 : unary_expression {
1767 $$ = new TArraySizes;
1770 parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
1771 $$->addInnerSize(size);
1773 | type_parameter_specifier_list COMMA unary_expression {
1777 parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
1778 $$->addInnerSize(size);
1782 type_specifier_nonarray
1784 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1785 $$.basicType = EbtVoid;
1788 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1789 $$.basicType = EbtFloat;
1792 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1793 $$.basicType = EbtInt;
1796 parseContext.fullIntegerCheck($1.loc, "unsigned integer");
1797 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1798 $$.basicType = EbtUint;
1801 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1802 $$.basicType = EbtBool;
1805 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1806 $$.basicType = EbtFloat;
1810 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1811 $$.basicType = EbtFloat;
1815 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1816 $$.basicType = EbtFloat;
1820 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1821 $$.basicType = EbtBool;
1825 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1826 $$.basicType = EbtBool;
1830 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1831 $$.basicType = EbtBool;
1835 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1836 $$.basicType = EbtInt;
1840 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1841 $$.basicType = EbtInt;
1845 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1846 $$.basicType = EbtInt;
1850 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1851 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1852 $$.basicType = EbtUint;
1856 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1857 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1858 $$.basicType = EbtUint;
1862 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1863 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1864 $$.basicType = EbtUint;
1868 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1869 $$.basicType = EbtFloat;
1873 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1874 $$.basicType = EbtFloat;
1878 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1879 $$.basicType = EbtFloat;
1883 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1884 $$.basicType = EbtFloat;
1888 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1889 $$.basicType = EbtFloat;
1893 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1894 $$.basicType = EbtFloat;
1898 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1899 $$.basicType = EbtFloat;
1903 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1904 $$.basicType = EbtFloat;
1908 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1909 $$.basicType = EbtFloat;
1913 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1914 $$.basicType = EbtFloat;
1918 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1919 $$.basicType = EbtFloat;
1923 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1924 $$.basicType = EbtFloat;
1929 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
1930 if (! parseContext.symbolTable.atBuiltInLevel())
1931 parseContext.doubleCheck($1.loc, "double");
1932 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1933 $$.basicType = EbtDouble;
1936 parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel());
1937 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1938 $$.basicType = EbtFloat16;
1941 parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel());
1942 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1943 $$.basicType = EbtFloat;
1946 parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel());
1947 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1948 $$.basicType = EbtDouble;
1951 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1952 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1953 $$.basicType = EbtInt8;
1956 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1957 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1958 $$.basicType = EbtUint8;
1961 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1962 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1963 $$.basicType = EbtInt16;
1966 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1967 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1968 $$.basicType = EbtUint16;
1971 parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1972 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1973 $$.basicType = EbtInt;
1976 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1977 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1978 $$.basicType = EbtUint;
1981 parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
1982 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1983 $$.basicType = EbtInt64;
1986 parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1987 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1988 $$.basicType = EbtUint64;
1991 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1992 if (! parseContext.symbolTable.atBuiltInLevel())
1993 parseContext.doubleCheck($1.loc, "double vector");
1994 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1995 $$.basicType = EbtDouble;
1999 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
2000 if (! parseContext.symbolTable.atBuiltInLevel())
2001 parseContext.doubleCheck($1.loc, "double vector");
2002 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2003 $$.basicType = EbtDouble;
2007 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
2008 if (! parseContext.symbolTable.atBuiltInLevel())
2009 parseContext.doubleCheck($1.loc, "double vector");
2010 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2011 $$.basicType = EbtDouble;
2015 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2016 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2017 $$.basicType = EbtFloat16;
2021 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2022 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2023 $$.basicType = EbtFloat16;
2027 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2028 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2029 $$.basicType = EbtFloat16;
2033 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2034 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2035 $$.basicType = EbtFloat;
2039 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2040 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2041 $$.basicType = EbtFloat;
2045 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2046 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2047 $$.basicType = EbtFloat;
2051 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2052 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2053 $$.basicType = EbtDouble;
2057 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2058 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2059 $$.basicType = EbtDouble;
2063 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2064 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2065 $$.basicType = EbtDouble;
2069 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2070 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2071 $$.basicType = EbtInt8;
2075 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2076 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2077 $$.basicType = EbtInt8;
2081 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2082 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2083 $$.basicType = EbtInt8;
2087 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2088 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2089 $$.basicType = EbtInt16;
2093 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2094 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2095 $$.basicType = EbtInt16;
2099 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2100 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2101 $$.basicType = EbtInt16;
2105 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2106 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2107 $$.basicType = EbtInt;
2111 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2112 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2113 $$.basicType = EbtInt;
2117 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2118 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2119 $$.basicType = EbtInt;
2123 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2124 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2125 $$.basicType = EbtInt64;
2129 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2130 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2131 $$.basicType = EbtInt64;
2135 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2136 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2137 $$.basicType = EbtInt64;
2141 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2142 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2143 $$.basicType = EbtUint8;
2147 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2148 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2149 $$.basicType = EbtUint8;
2153 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2154 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2155 $$.basicType = EbtUint8;
2159 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2160 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2161 $$.basicType = EbtUint16;
2165 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2166 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2167 $$.basicType = EbtUint16;
2171 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2172 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2173 $$.basicType = EbtUint16;
2177 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2178 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2179 $$.basicType = EbtUint;
2183 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2184 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2185 $$.basicType = EbtUint;
2189 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2190 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2191 $$.basicType = EbtUint;
2195 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2196 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2197 $$.basicType = EbtUint64;
2201 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2202 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2203 $$.basicType = EbtUint64;
2207 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2208 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2209 $$.basicType = EbtUint64;
2213 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2214 if (! parseContext.symbolTable.atBuiltInLevel())
2215 parseContext.doubleCheck($1.loc, "double matrix");
2216 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2217 $$.basicType = EbtDouble;
2221 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2222 if (! parseContext.symbolTable.atBuiltInLevel())
2223 parseContext.doubleCheck($1.loc, "double matrix");
2224 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2225 $$.basicType = EbtDouble;
2229 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2230 if (! parseContext.symbolTable.atBuiltInLevel())
2231 parseContext.doubleCheck($1.loc, "double matrix");
2232 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2233 $$.basicType = EbtDouble;
2237 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2238 if (! parseContext.symbolTable.atBuiltInLevel())
2239 parseContext.doubleCheck($1.loc, "double matrix");
2240 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2241 $$.basicType = EbtDouble;
2245 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2246 if (! parseContext.symbolTable.atBuiltInLevel())
2247 parseContext.doubleCheck($1.loc, "double matrix");
2248 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2249 $$.basicType = EbtDouble;
2253 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2254 if (! parseContext.symbolTable.atBuiltInLevel())
2255 parseContext.doubleCheck($1.loc, "double matrix");
2256 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2257 $$.basicType = EbtDouble;
2261 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2262 if (! parseContext.symbolTable.atBuiltInLevel())
2263 parseContext.doubleCheck($1.loc, "double matrix");
2264 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2265 $$.basicType = EbtDouble;
2269 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2270 if (! parseContext.symbolTable.atBuiltInLevel())
2271 parseContext.doubleCheck($1.loc, "double matrix");
2272 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2273 $$.basicType = EbtDouble;
2277 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2278 if (! parseContext.symbolTable.atBuiltInLevel())
2279 parseContext.doubleCheck($1.loc, "double matrix");
2280 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2281 $$.basicType = EbtDouble;
2285 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2286 if (! parseContext.symbolTable.atBuiltInLevel())
2287 parseContext.doubleCheck($1.loc, "double matrix");
2288 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2289 $$.basicType = EbtDouble;
2293 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2294 if (! parseContext.symbolTable.atBuiltInLevel())
2295 parseContext.doubleCheck($1.loc, "double matrix");
2296 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2297 $$.basicType = EbtDouble;
2301 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2302 if (! parseContext.symbolTable.atBuiltInLevel())
2303 parseContext.doubleCheck($1.loc, "double matrix");
2304 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2305 $$.basicType = EbtDouble;
2309 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2310 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2311 $$.basicType = EbtFloat16;
2315 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2316 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2317 $$.basicType = EbtFloat16;
2321 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2322 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2323 $$.basicType = EbtFloat16;
2327 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2328 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2329 $$.basicType = EbtFloat16;
2333 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2334 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2335 $$.basicType = EbtFloat16;
2339 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2340 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2341 $$.basicType = EbtFloat16;
2345 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2346 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2347 $$.basicType = EbtFloat16;
2351 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2352 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2353 $$.basicType = EbtFloat16;
2357 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2358 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2359 $$.basicType = EbtFloat16;
2363 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2364 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2365 $$.basicType = EbtFloat16;
2369 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2370 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2371 $$.basicType = EbtFloat16;
2375 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2376 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2377 $$.basicType = EbtFloat16;
2381 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2382 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2383 $$.basicType = EbtFloat;
2387 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2388 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2389 $$.basicType = EbtFloat;
2393 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2394 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2395 $$.basicType = EbtFloat;
2399 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2400 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2401 $$.basicType = EbtFloat;
2405 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2406 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2407 $$.basicType = EbtFloat;
2411 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2412 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2413 $$.basicType = EbtFloat;
2417 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2418 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2419 $$.basicType = EbtFloat;
2423 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2424 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2425 $$.basicType = EbtFloat;
2429 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2430 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2431 $$.basicType = EbtFloat;
2435 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2436 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2437 $$.basicType = EbtFloat;
2441 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2442 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2443 $$.basicType = EbtFloat;
2447 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2448 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2449 $$.basicType = EbtFloat;
2453 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2454 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2455 $$.basicType = EbtDouble;
2459 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2460 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2461 $$.basicType = EbtDouble;
2465 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2466 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2467 $$.basicType = EbtDouble;
2471 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2472 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2473 $$.basicType = EbtDouble;
2477 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2478 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2479 $$.basicType = EbtDouble;
2483 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2484 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2485 $$.basicType = EbtDouble;
2489 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2490 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2491 $$.basicType = EbtDouble;
2495 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2496 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2497 $$.basicType = EbtDouble;
2501 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2502 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2503 $$.basicType = EbtDouble;
2507 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2508 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2509 $$.basicType = EbtDouble;
2513 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2514 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2515 $$.basicType = EbtDouble;
2519 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2520 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2521 $$.basicType = EbtDouble;
2525 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2526 $$.basicType = EbtAccStruct;
2529 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2530 $$.basicType = EbtAccStruct;
2533 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2534 $$.basicType = EbtRayQuery;
2537 parseContext.vulkanRemoved($1.loc, "atomic counter types");
2538 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2539 $$.basicType = EbtAtomicUint;
2542 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2543 $$.basicType = EbtSampler;
2544 $$.sampler.set(EbtFloat, Esd1D);
2548 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2549 $$.basicType = EbtSampler;
2550 $$.sampler.set(EbtFloat, Esd2D);
2553 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2554 $$.basicType = EbtSampler;
2555 $$.sampler.set(EbtFloat, Esd3D);
2558 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2559 $$.basicType = EbtSampler;
2560 $$.sampler.set(EbtFloat, EsdCube);
2563 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2564 $$.basicType = EbtSampler;
2565 $$.sampler.set(EbtFloat, Esd2D, false, true);
2567 | SAMPLERCUBESHADOW {
2568 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2569 $$.basicType = EbtSampler;
2570 $$.sampler.set(EbtFloat, EsdCube, false, true);
2573 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2574 $$.basicType = EbtSampler;
2575 $$.sampler.set(EbtFloat, Esd2D, true);
2577 | SAMPLER2DARRAYSHADOW {
2578 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2579 $$.basicType = EbtSampler;
2580 $$.sampler.set(EbtFloat, Esd2D, true, true);
2584 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2585 $$.basicType = EbtSampler;
2586 $$.sampler.set(EbtFloat, Esd1D, false, true);
2589 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2590 $$.basicType = EbtSampler;
2591 $$.sampler.set(EbtFloat, Esd1D, true);
2593 | SAMPLER1DARRAYSHADOW {
2594 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2595 $$.basicType = EbtSampler;
2596 $$.sampler.set(EbtFloat, Esd1D, true, true);
2598 | SAMPLERCUBEARRAY {
2599 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2600 $$.basicType = EbtSampler;
2601 $$.sampler.set(EbtFloat, EsdCube, true);
2603 | SAMPLERCUBEARRAYSHADOW {
2604 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2605 $$.basicType = EbtSampler;
2606 $$.sampler.set(EbtFloat, EsdCube, true, true);
2609 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2610 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2611 $$.basicType = EbtSampler;
2612 $$.sampler.set(EbtFloat16, Esd1D);
2615 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2616 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2617 $$.basicType = EbtSampler;
2618 $$.sampler.set(EbtFloat16, Esd2D);
2621 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2622 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2623 $$.basicType = EbtSampler;
2624 $$.sampler.set(EbtFloat16, Esd3D);
2627 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2628 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2629 $$.basicType = EbtSampler;
2630 $$.sampler.set(EbtFloat16, EsdCube);
2632 | F16SAMPLER1DSHADOW {
2633 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2634 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2635 $$.basicType = EbtSampler;
2636 $$.sampler.set(EbtFloat16, Esd1D, false, true);
2638 | F16SAMPLER2DSHADOW {
2639 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2640 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2641 $$.basicType = EbtSampler;
2642 $$.sampler.set(EbtFloat16, Esd2D, false, true);
2644 | F16SAMPLERCUBESHADOW {
2645 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2646 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2647 $$.basicType = EbtSampler;
2648 $$.sampler.set(EbtFloat16, EsdCube, false, true);
2650 | F16SAMPLER1DARRAY {
2651 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2652 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2653 $$.basicType = EbtSampler;
2654 $$.sampler.set(EbtFloat16, Esd1D, true);
2656 | F16SAMPLER2DARRAY {
2657 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2658 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2659 $$.basicType = EbtSampler;
2660 $$.sampler.set(EbtFloat16, Esd2D, true);
2662 | F16SAMPLER1DARRAYSHADOW {
2663 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2664 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2665 $$.basicType = EbtSampler;
2666 $$.sampler.set(EbtFloat16, Esd1D, true, true);
2668 | F16SAMPLER2DARRAYSHADOW {
2669 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2670 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2671 $$.basicType = EbtSampler;
2672 $$.sampler.set(EbtFloat16, Esd2D, true, true);
2674 | F16SAMPLERCUBEARRAY {
2675 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2676 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2677 $$.basicType = EbtSampler;
2678 $$.sampler.set(EbtFloat16, EsdCube, true);
2680 | F16SAMPLERCUBEARRAYSHADOW {
2681 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2682 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2683 $$.basicType = EbtSampler;
2684 $$.sampler.set(EbtFloat16, EsdCube, true, true);
2687 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2688 $$.basicType = EbtSampler;
2689 $$.sampler.set(EbtInt, Esd1D);
2693 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2694 $$.basicType = EbtSampler;
2695 $$.sampler.set(EbtInt, Esd2D);
2698 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2699 $$.basicType = EbtSampler;
2700 $$.sampler.set(EbtInt, Esd3D);
2703 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2704 $$.basicType = EbtSampler;
2705 $$.sampler.set(EbtInt, EsdCube);
2708 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2709 $$.basicType = EbtSampler;
2710 $$.sampler.set(EbtInt, Esd2D, true);
2713 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2714 $$.basicType = EbtSampler;
2715 $$.sampler.set(EbtUint, Esd2D);
2718 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2719 $$.basicType = EbtSampler;
2720 $$.sampler.set(EbtUint, Esd3D);
2723 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2724 $$.basicType = EbtSampler;
2725 $$.sampler.set(EbtUint, EsdCube);
2729 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2730 $$.basicType = EbtSampler;
2731 $$.sampler.set(EbtInt, Esd1D, true);
2733 | ISAMPLERCUBEARRAY {
2734 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2735 $$.basicType = EbtSampler;
2736 $$.sampler.set(EbtInt, EsdCube, true);
2739 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2740 $$.basicType = EbtSampler;
2741 $$.sampler.set(EbtUint, Esd1D);
2744 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2745 $$.basicType = EbtSampler;
2746 $$.sampler.set(EbtUint, Esd1D, true);
2748 | USAMPLERCUBEARRAY {
2749 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2750 $$.basicType = EbtSampler;
2751 $$.sampler.set(EbtUint, EsdCube, true);
2753 | TEXTURECUBEARRAY {
2754 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2755 $$.basicType = EbtSampler;
2756 $$.sampler.setTexture(EbtFloat, EsdCube, true);
2758 | ITEXTURECUBEARRAY {
2759 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2760 $$.basicType = EbtSampler;
2761 $$.sampler.setTexture(EbtInt, EsdCube, true);
2763 | UTEXTURECUBEARRAY {
2764 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2765 $$.basicType = EbtSampler;
2766 $$.sampler.setTexture(EbtUint, EsdCube, true);
2770 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2771 $$.basicType = EbtSampler;
2772 $$.sampler.set(EbtUint, Esd2D, true);
2775 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2776 $$.basicType = EbtSampler;
2777 $$.sampler.setTexture(EbtFloat, Esd2D);
2780 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2781 $$.basicType = EbtSampler;
2782 $$.sampler.setTexture(EbtFloat, Esd3D);
2785 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2786 $$.basicType = EbtSampler;
2787 $$.sampler.setTexture(EbtFloat, Esd2D, true);
2790 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2791 $$.basicType = EbtSampler;
2792 $$.sampler.setTexture(EbtFloat, EsdCube);
2795 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2796 $$.basicType = EbtSampler;
2797 $$.sampler.setTexture(EbtInt, Esd2D);
2800 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2801 $$.basicType = EbtSampler;
2802 $$.sampler.setTexture(EbtInt, Esd3D);
2805 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2806 $$.basicType = EbtSampler;
2807 $$.sampler.setTexture(EbtInt, EsdCube);
2810 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2811 $$.basicType = EbtSampler;
2812 $$.sampler.setTexture(EbtInt, Esd2D, true);
2815 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2816 $$.basicType = EbtSampler;
2817 $$.sampler.setTexture(EbtUint, Esd2D);
2820 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2821 $$.basicType = EbtSampler;
2822 $$.sampler.setTexture(EbtUint, Esd3D);
2825 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2826 $$.basicType = EbtSampler;
2827 $$.sampler.setTexture(EbtUint, EsdCube);
2830 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2831 $$.basicType = EbtSampler;
2832 $$.sampler.setTexture(EbtUint, Esd2D, true);
2835 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2836 $$.basicType = EbtSampler;
2837 $$.sampler.setPureSampler(false);
2840 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2841 $$.basicType = EbtSampler;
2842 $$.sampler.setPureSampler(true);
2846 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2847 $$.basicType = EbtSampler;
2848 $$.sampler.set(EbtFloat, EsdRect);
2850 | SAMPLER2DRECTSHADOW {
2851 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2852 $$.basicType = EbtSampler;
2853 $$.sampler.set(EbtFloat, EsdRect, false, true);
2855 | F16SAMPLER2DRECT {
2856 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2857 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2858 $$.basicType = EbtSampler;
2859 $$.sampler.set(EbtFloat16, EsdRect);
2861 | F16SAMPLER2DRECTSHADOW {
2862 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2863 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2864 $$.basicType = EbtSampler;
2865 $$.sampler.set(EbtFloat16, EsdRect, false, true);
2868 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2869 $$.basicType = EbtSampler;
2870 $$.sampler.set(EbtInt, EsdRect);
2873 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2874 $$.basicType = EbtSampler;
2875 $$.sampler.set(EbtUint, EsdRect);
2878 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2879 $$.basicType = EbtSampler;
2880 $$.sampler.set(EbtFloat, EsdBuffer);
2882 | F16SAMPLERBUFFER {
2883 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2884 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2885 $$.basicType = EbtSampler;
2886 $$.sampler.set(EbtFloat16, EsdBuffer);
2889 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2890 $$.basicType = EbtSampler;
2891 $$.sampler.set(EbtInt, EsdBuffer);
2894 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2895 $$.basicType = EbtSampler;
2896 $$.sampler.set(EbtUint, EsdBuffer);
2899 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2900 $$.basicType = EbtSampler;
2901 $$.sampler.set(EbtFloat, Esd2D, false, false, true);
2904 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2905 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2906 $$.basicType = EbtSampler;
2907 $$.sampler.set(EbtFloat16, Esd2D, false, false, true);
2910 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2911 $$.basicType = EbtSampler;
2912 $$.sampler.set(EbtInt, Esd2D, false, false, true);
2915 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2916 $$.basicType = EbtSampler;
2917 $$.sampler.set(EbtUint, Esd2D, false, false, true);
2919 | SAMPLER2DMSARRAY {
2920 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2921 $$.basicType = EbtSampler;
2922 $$.sampler.set(EbtFloat, Esd2D, true, false, true);
2924 | F16SAMPLER2DMSARRAY {
2925 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2926 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2927 $$.basicType = EbtSampler;
2928 $$.sampler.set(EbtFloat16, Esd2D, true, false, true);
2930 | ISAMPLER2DMSARRAY {
2931 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2932 $$.basicType = EbtSampler;
2933 $$.sampler.set(EbtInt, Esd2D, true, false, true);
2935 | USAMPLER2DMSARRAY {
2936 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2937 $$.basicType = EbtSampler;
2938 $$.sampler.set(EbtUint, Esd2D, true, false, true);
2941 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2942 $$.basicType = EbtSampler;
2943 $$.sampler.setTexture(EbtFloat, Esd1D);
2946 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2947 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2948 $$.basicType = EbtSampler;
2949 $$.sampler.setTexture(EbtFloat16, Esd1D);
2952 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2953 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2954 $$.basicType = EbtSampler;
2955 $$.sampler.setTexture(EbtFloat16, Esd2D);
2958 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2959 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2960 $$.basicType = EbtSampler;
2961 $$.sampler.setTexture(EbtFloat16, Esd3D);
2964 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2965 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2966 $$.basicType = EbtSampler;
2967 $$.sampler.setTexture(EbtFloat16, EsdCube);
2970 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2971 $$.basicType = EbtSampler;
2972 $$.sampler.setTexture(EbtFloat, Esd1D, true);
2974 | F16TEXTURE1DARRAY {
2975 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2976 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2977 $$.basicType = EbtSampler;
2978 $$.sampler.setTexture(EbtFloat16, Esd1D, true);
2980 | F16TEXTURE2DARRAY {
2981 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2982 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2983 $$.basicType = EbtSampler;
2984 $$.sampler.setTexture(EbtFloat16, Esd2D, true);
2986 | F16TEXTURECUBEARRAY {
2987 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2988 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2989 $$.basicType = EbtSampler;
2990 $$.sampler.setTexture(EbtFloat16, EsdCube, true);
2993 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2994 $$.basicType = EbtSampler;
2995 $$.sampler.setTexture(EbtInt, Esd1D);
2998 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2999 $$.basicType = EbtSampler;
3000 $$.sampler.setTexture(EbtInt, Esd1D, true);
3003 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3004 $$.basicType = EbtSampler;
3005 $$.sampler.setTexture(EbtUint, Esd1D);
3008 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3009 $$.basicType = EbtSampler;
3010 $$.sampler.setTexture(EbtUint, Esd1D, true);
3013 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3014 $$.basicType = EbtSampler;
3015 $$.sampler.setTexture(EbtFloat, EsdRect);
3017 | F16TEXTURE2DRECT {
3018 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3019 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3020 $$.basicType = EbtSampler;
3021 $$.sampler.setTexture(EbtFloat16, EsdRect);
3024 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3025 $$.basicType = EbtSampler;
3026 $$.sampler.setTexture(EbtInt, EsdRect);
3029 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3030 $$.basicType = EbtSampler;
3031 $$.sampler.setTexture(EbtUint, EsdRect);
3034 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3035 $$.basicType = EbtSampler;
3036 $$.sampler.setTexture(EbtFloat, EsdBuffer);
3038 | F16TEXTUREBUFFER {
3039 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3040 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3041 $$.basicType = EbtSampler;
3042 $$.sampler.setTexture(EbtFloat16, EsdBuffer);
3045 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3046 $$.basicType = EbtSampler;
3047 $$.sampler.setTexture(EbtInt, EsdBuffer);
3050 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3051 $$.basicType = EbtSampler;
3052 $$.sampler.setTexture(EbtUint, EsdBuffer);
3055 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3056 $$.basicType = EbtSampler;
3057 $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true);
3060 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3061 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3062 $$.basicType = EbtSampler;
3063 $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true);
3066 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3067 $$.basicType = EbtSampler;
3068 $$.sampler.setTexture(EbtInt, Esd2D, false, false, true);
3071 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3072 $$.basicType = EbtSampler;
3073 $$.sampler.setTexture(EbtUint, Esd2D, false, false, true);
3075 | TEXTURE2DMSARRAY {
3076 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3077 $$.basicType = EbtSampler;
3078 $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true);
3080 | F16TEXTURE2DMSARRAY {
3081 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3082 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3083 $$.basicType = EbtSampler;
3084 $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true);
3086 | ITEXTURE2DMSARRAY {
3087 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3088 $$.basicType = EbtSampler;
3089 $$.sampler.setTexture(EbtInt, Esd2D, true, false, true);
3091 | UTEXTURE2DMSARRAY {
3092 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3093 $$.basicType = EbtSampler;
3094 $$.sampler.setTexture(EbtUint, Esd2D, true, false, true);
3097 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3098 $$.basicType = EbtSampler;
3099 $$.sampler.setImage(EbtFloat, Esd1D);
3102 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3103 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3104 $$.basicType = EbtSampler;
3105 $$.sampler.setImage(EbtFloat16, Esd1D);
3108 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3109 $$.basicType = EbtSampler;
3110 $$.sampler.setImage(EbtInt, Esd1D);
3113 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3114 $$.basicType = EbtSampler;
3115 $$.sampler.setImage(EbtUint, Esd1D);
3118 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3119 $$.basicType = EbtSampler;
3120 $$.sampler.setImage(EbtFloat, Esd2D);
3123 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3124 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3125 $$.basicType = EbtSampler;
3126 $$.sampler.setImage(EbtFloat16, Esd2D);
3129 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3130 $$.basicType = EbtSampler;
3131 $$.sampler.setImage(EbtInt, Esd2D);
3134 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3135 $$.basicType = EbtSampler;
3136 $$.sampler.setImage(EbtUint, Esd2D);
3139 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3140 $$.basicType = EbtSampler;
3141 $$.sampler.setImage(EbtFloat, Esd3D);
3144 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3145 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3146 $$.basicType = EbtSampler;
3147 $$.sampler.setImage(EbtFloat16, Esd3D);
3150 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3151 $$.basicType = EbtSampler;
3152 $$.sampler.setImage(EbtInt, Esd3D);
3155 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3156 $$.basicType = EbtSampler;
3157 $$.sampler.setImage(EbtUint, Esd3D);
3160 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3161 $$.basicType = EbtSampler;
3162 $$.sampler.setImage(EbtFloat, EsdRect);
3165 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3166 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3167 $$.basicType = EbtSampler;
3168 $$.sampler.setImage(EbtFloat16, EsdRect);
3171 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3172 $$.basicType = EbtSampler;
3173 $$.sampler.setImage(EbtInt, EsdRect);
3176 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3177 $$.basicType = EbtSampler;
3178 $$.sampler.setImage(EbtUint, EsdRect);
3181 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3182 $$.basicType = EbtSampler;
3183 $$.sampler.setImage(EbtFloat, EsdCube);
3186 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3187 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3188 $$.basicType = EbtSampler;
3189 $$.sampler.setImage(EbtFloat16, EsdCube);
3192 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3193 $$.basicType = EbtSampler;
3194 $$.sampler.setImage(EbtInt, EsdCube);
3197 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3198 $$.basicType = EbtSampler;
3199 $$.sampler.setImage(EbtUint, EsdCube);
3202 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3203 $$.basicType = EbtSampler;
3204 $$.sampler.setImage(EbtFloat, EsdBuffer);
3207 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3208 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3209 $$.basicType = EbtSampler;
3210 $$.sampler.setImage(EbtFloat16, EsdBuffer);
3213 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3214 $$.basicType = EbtSampler;
3215 $$.sampler.setImage(EbtInt, EsdBuffer);
3218 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3219 $$.basicType = EbtSampler;
3220 $$.sampler.setImage(EbtUint, EsdBuffer);
3223 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3224 $$.basicType = EbtSampler;
3225 $$.sampler.setImage(EbtFloat, Esd1D, true);
3228 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3229 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3230 $$.basicType = EbtSampler;
3231 $$.sampler.setImage(EbtFloat16, Esd1D, true);
3234 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3235 $$.basicType = EbtSampler;
3236 $$.sampler.setImage(EbtInt, Esd1D, true);
3239 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3240 $$.basicType = EbtSampler;
3241 $$.sampler.setImage(EbtUint, Esd1D, true);
3244 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3245 $$.basicType = EbtSampler;
3246 $$.sampler.setImage(EbtFloat, Esd2D, true);
3249 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3250 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3251 $$.basicType = EbtSampler;
3252 $$.sampler.setImage(EbtFloat16, Esd2D, true);
3255 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3256 $$.basicType = EbtSampler;
3257 $$.sampler.setImage(EbtInt, Esd2D, true);
3260 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3261 $$.basicType = EbtSampler;
3262 $$.sampler.setImage(EbtUint, Esd2D, true);
3265 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3266 $$.basicType = EbtSampler;
3267 $$.sampler.setImage(EbtFloat, EsdCube, true);
3269 | F16IMAGECUBEARRAY {
3270 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3271 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3272 $$.basicType = EbtSampler;
3273 $$.sampler.setImage(EbtFloat16, EsdCube, true);
3276 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3277 $$.basicType = EbtSampler;
3278 $$.sampler.setImage(EbtInt, EsdCube, true);
3281 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3282 $$.basicType = EbtSampler;
3283 $$.sampler.setImage(EbtUint, EsdCube, true);
3286 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3287 $$.basicType = EbtSampler;
3288 $$.sampler.setImage(EbtFloat, Esd2D, false, false, true);
3291 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3292 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3293 $$.basicType = EbtSampler;
3294 $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true);
3297 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3298 $$.basicType = EbtSampler;
3299 $$.sampler.setImage(EbtInt, Esd2D, false, false, true);
3302 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3303 $$.basicType = EbtSampler;
3304 $$.sampler.setImage(EbtUint, Esd2D, false, false, true);
3307 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3308 $$.basicType = EbtSampler;
3309 $$.sampler.setImage(EbtFloat, Esd2D, true, false, true);
3311 | F16IMAGE2DMSARRAY {
3312 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3313 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3314 $$.basicType = EbtSampler;
3315 $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true);
3318 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3319 $$.basicType = EbtSampler;
3320 $$.sampler.setImage(EbtInt, Esd2D, true, false, true);
3323 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3324 $$.basicType = EbtSampler;
3325 $$.sampler.setImage(EbtUint, Esd2D, true, false, true);
3328 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3329 $$.basicType = EbtSampler;
3330 $$.sampler.setImage(EbtInt64, Esd1D);
3333 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3334 $$.basicType = EbtSampler;
3335 $$.sampler.setImage(EbtUint64, Esd1D);
3338 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3339 $$.basicType = EbtSampler;
3340 $$.sampler.setImage(EbtInt64, Esd2D);
3343 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3344 $$.basicType = EbtSampler;
3345 $$.sampler.setImage(EbtUint64, Esd2D);
3348 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3349 $$.basicType = EbtSampler;
3350 $$.sampler.setImage(EbtInt64, Esd3D);
3353 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3354 $$.basicType = EbtSampler;
3355 $$.sampler.setImage(EbtUint64, Esd3D);
3358 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3359 $$.basicType = EbtSampler;
3360 $$.sampler.setImage(EbtInt64, EsdRect);
3363 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3364 $$.basicType = EbtSampler;
3365 $$.sampler.setImage(EbtUint64, EsdRect);
3368 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3369 $$.basicType = EbtSampler;
3370 $$.sampler.setImage(EbtInt64, EsdCube);
3373 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3374 $$.basicType = EbtSampler;
3375 $$.sampler.setImage(EbtUint64, EsdCube);
3378 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3379 $$.basicType = EbtSampler;
3380 $$.sampler.setImage(EbtInt64, EsdBuffer);
3383 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3384 $$.basicType = EbtSampler;
3385 $$.sampler.setImage(EbtUint64, EsdBuffer);
3388 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3389 $$.basicType = EbtSampler;
3390 $$.sampler.setImage(EbtInt64, Esd1D, true);
3393 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3394 $$.basicType = EbtSampler;
3395 $$.sampler.setImage(EbtUint64, Esd1D, true);
3398 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3399 $$.basicType = EbtSampler;
3400 $$.sampler.setImage(EbtInt64, Esd2D, true);
3403 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3404 $$.basicType = EbtSampler;
3405 $$.sampler.setImage(EbtUint64, Esd2D, true);
3407 | I64IMAGECUBEARRAY {
3408 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3409 $$.basicType = EbtSampler;
3410 $$.sampler.setImage(EbtInt64, EsdCube, true);
3412 | U64IMAGECUBEARRAY {
3413 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3414 $$.basicType = EbtSampler;
3415 $$.sampler.setImage(EbtUint64, EsdCube, true);
3418 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3419 $$.basicType = EbtSampler;
3420 $$.sampler.setImage(EbtInt64, Esd2D, false, false, true);
3423 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3424 $$.basicType = EbtSampler;
3425 $$.sampler.setImage(EbtUint64, Esd2D, false, false, true);
3427 | I64IMAGE2DMSARRAY {
3428 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3429 $$.basicType = EbtSampler;
3430 $$.sampler.setImage(EbtInt64, Esd2D, true, false, true);
3432 | U64IMAGE2DMSARRAY {
3433 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3434 $$.basicType = EbtSampler;
3435 $$.sampler.setImage(EbtUint64, Esd2D, true, false, true);
3437 | SAMPLEREXTERNALOES { // GL_OES_EGL_image_external
3438 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3439 $$.basicType = EbtSampler;
3440 $$.sampler.set(EbtFloat, Esd2D);
3441 $$.sampler.external = true;
3443 | SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target
3444 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3445 $$.basicType = EbtSampler;
3446 $$.sampler.set(EbtFloat, Esd2D);
3447 $$.sampler.yuv = true;
3450 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3451 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3452 $$.basicType = EbtSampler;
3453 $$.sampler.setSubpass(EbtFloat);
3456 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3457 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3458 $$.basicType = EbtSampler;
3459 $$.sampler.setSubpass(EbtFloat, true);
3462 parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
3463 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3464 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3465 $$.basicType = EbtSampler;
3466 $$.sampler.setSubpass(EbtFloat16);
3468 | F16SUBPASSINPUTMS {
3469 parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
3470 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3471 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3472 $$.basicType = EbtSampler;
3473 $$.sampler.setSubpass(EbtFloat16, true);
3476 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3477 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3478 $$.basicType = EbtSampler;
3479 $$.sampler.setSubpass(EbtInt);
3482 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3483 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3484 $$.basicType = EbtSampler;
3485 $$.sampler.setSubpass(EbtInt, true);
3488 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3489 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3490 $$.basicType = EbtSampler;
3491 $$.sampler.setSubpass(EbtUint);
3494 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3495 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3496 $$.basicType = EbtSampler;
3497 $$.sampler.setSubpass(EbtUint, true);
3500 parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3501 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3502 $$.basicType = EbtFloat;
3506 parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3507 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3508 $$.basicType = EbtInt;
3512 parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3513 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3514 $$.basicType = EbtUint;
3517 | spirv_type_specifier {
3518 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
3522 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3523 $$.basicType = EbtHitObjectNV;
3526 | struct_specifier {
3528 $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3529 parseContext.structTypeCheck($$.loc, $$);
3533 // This is for user defined type names. The lexical phase looked up the
3536 if (const TVariable* variable = ($1.symbol)->getAsVariable()) {
3537 const TType& structure = variable->getType();
3538 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3539 $$.basicType = EbtStruct;
3540 $$.userDef = &structure;
3542 parseContext.error($1.loc, "expected type name", $1.string->c_str(), "");
3548 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "highp precision qualifier");
3549 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3550 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqHigh);
3552 | MEDIUM_PRECISION {
3553 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "mediump precision qualifier");
3554 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3555 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqMedium);
3558 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "lowp precision qualifier");
3559 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3560 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqLow);
3565 : STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
3566 TType* structure = new TType($5, *$2.string);
3567 parseContext.structArrayCheck($2.loc, *structure);
3568 TVariable* userTypeDef = new TVariable($2.string, *structure, true);
3569 if (! parseContext.symbolTable.insert(*userTypeDef))
3570 parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct");
3572 $$.basicType = EbtStruct;
3573 $$.userDef = structure;
3574 --parseContext.structNestingLevel;
3576 | STRUCT LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
3577 TType* structure = new TType($4, TString(""));
3579 $$.basicType = EbtStruct;
3580 $$.userDef = structure;
3581 --parseContext.structNestingLevel;
3585 struct_declaration_list
3586 : struct_declaration {
3589 | struct_declaration_list struct_declaration {
3591 for (unsigned int i = 0; i < $2->size(); ++i) {
3592 for (unsigned int j = 0; j < $$->size(); ++j) {
3593 if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName())
3594 parseContext.error((*$2)[i].loc, "duplicate member name:", "", (*$2)[i].type->getFieldName().c_str());
3596 $$->push_back((*$2)[i]);
3602 : type_specifier struct_declarator_list SEMICOLON {
3603 if ($1.arraySizes) {
3604 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
3605 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
3606 if (parseContext.isEsProfile())
3607 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
3612 parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
3613 parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
3615 for (unsigned int i = 0; i < $$->size(); ++i) {
3617 type.setFieldName((*$$)[i].type->getFieldName());
3618 type.transferArraySizes((*$$)[i].type->getArraySizes());
3619 type.copyArrayInnerSizes($1.arraySizes);
3620 parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
3621 (*$$)[i].type->shallowCopy(type);
3624 | type_qualifier type_specifier struct_declarator_list SEMICOLON {
3625 if ($2.arraySizes) {
3626 parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
3627 parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
3628 if (parseContext.isEsProfile())
3629 parseContext.arraySizeRequiredCheck($2.loc, *$2.arraySizes);
3634 parseContext.memberQualifierCheck($1);
3635 parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
3636 parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
3637 parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
3639 for (unsigned int i = 0; i < $$->size(); ++i) {
3641 type.setFieldName((*$$)[i].type->getFieldName());
3642 type.transferArraySizes((*$$)[i].type->getArraySizes());
3643 type.copyArrayInnerSizes($2.arraySizes);
3644 parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
3645 (*$$)[i].type->shallowCopy(type);
3650 struct_declarator_list
3651 : struct_declarator {
3655 | struct_declarator_list COMMA struct_declarator {
3662 $$.type = new TType(EbtVoid);
3664 $$.type->setFieldName(*$1.string);
3666 | IDENTIFIER array_specifier {
3667 parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes);
3669 $$.type = new TType(EbtVoid);
3671 $$.type->setFieldName(*$1.string);
3672 $$.type->transferArraySizes($2.arraySizes);
3677 : assignment_expression {
3681 | LEFT_BRACE initializer_list RIGHT_BRACE {
3682 const char* initFeature = "{ } style initializers";
3683 parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
3684 parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
3687 | LEFT_BRACE initializer_list COMMA RIGHT_BRACE {
3688 const char* initFeature = "{ } style initializers";
3689 parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
3690 parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
3693 | LEFT_BRACE RIGHT_BRACE {
3694 const char* initFeature = "empty { } initializer";
3695 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
3696 parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
3697 $$ = parseContext.intermediate.makeAggregate($1.loc);
3705 $$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
3707 | initializer_list COMMA initializer {
3708 $$ = parseContext.intermediate.growAggregate($1, $3);
3713 declaration_statement
3714 : declaration { $$ = $1; }
3718 : compound_statement { $$ = $1; }
3719 | simple_statement { $$ = $1; }
3722 // Grammar Note: labeled statements for switch statements only; 'goto' is not supported.
3725 : declaration_statement { $$ = $1; }
3726 | expression_statement { $$ = $1; }
3727 | selection_statement { $$ = $1; }
3728 | switch_statement { $$ = $1; }
3729 | case_label { $$ = $1; }
3730 | iteration_statement { $$ = $1; }
3731 | jump_statement { $$ = $1; }
3733 | demote_statement { $$ = $1; }
3739 : DEMOTE SEMICOLON {
3740 parseContext.requireStage($1.loc, EShLangFragment, "demote");
3741 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote");
3742 $$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc);
3748 : LEFT_BRACE RIGHT_BRACE { $$ = 0; }
3750 parseContext.symbolTable.push();
3751 ++parseContext.statementNestingLevel;
3754 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3755 --parseContext.statementNestingLevel;
3758 if ($3 && $3->getAsAggregate())
3759 $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
3764 statement_no_new_scope
3765 : compound_statement_no_new_scope { $$ = $1; }
3766 | simple_statement { $$ = $1; }
3771 ++parseContext.controlFlowNestingLevel;
3773 compound_statement {
3774 --parseContext.controlFlowNestingLevel;
3778 parseContext.symbolTable.push();
3779 ++parseContext.statementNestingLevel;
3780 ++parseContext.controlFlowNestingLevel;
3783 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3784 --parseContext.statementNestingLevel;
3785 --parseContext.controlFlowNestingLevel;
3789 compound_statement_no_new_scope
3790 // Statement that doesn't create a new scope, for selection_statement, iteration_statement
3791 : LEFT_BRACE RIGHT_BRACE {
3794 | LEFT_BRACE statement_list RIGHT_BRACE {
3795 if ($2 && $2->getAsAggregate())
3796 $2->getAsAggregate()->setOperator(EOpSequence);
3803 $$ = parseContext.intermediate.makeAggregate($1);
3804 if ($1 && $1->getAsBranchNode() && ($1->getAsBranchNode()->getFlowOp() == EOpCase ||
3805 $1->getAsBranchNode()->getFlowOp() == EOpDefault)) {
3806 parseContext.wrapupSwitchSubsequence(0, $1);
3807 $$ = 0; // start a fresh subsequence for what's after this case
3810 | statement_list statement {
3811 if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase ||
3812 $2->getAsBranchNode()->getFlowOp() == EOpDefault)) {
3813 parseContext.wrapupSwitchSubsequence($1 ? $1->getAsAggregate() : 0, $2);
3814 $$ = 0; // start a fresh subsequence for what's after this case
3816 $$ = parseContext.intermediate.growAggregate($1, $2);
3820 expression_statement
3821 : SEMICOLON { $$ = 0; }
3822 | expression SEMICOLON { $$ = static_cast<TIntermNode*>($1); }
3826 : selection_statement_nonattributed {
3830 | attribute selection_statement_nonattributed {
3831 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3832 parseContext.handleSelectionAttributes(*$1, $2);
3837 selection_statement_nonattributed
3838 : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
3839 parseContext.boolCheck($1.loc, $3);
3840 $$ = parseContext.intermediate.addSelection($3, $5, $1.loc);
3844 selection_rest_statement
3845 : statement_scoped ELSE statement_scoped {
3849 | statement_scoped {
3856 // In 1996 c++ draft, conditions can include single declarations
3859 parseContext.boolCheck($1->getLoc(), $1);
3861 | fully_specified_type IDENTIFIER EQUAL initializer {
3862 parseContext.boolCheck($2.loc, $1);
3865 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
3867 $$ = initNode->getAsTyped();
3874 : switch_statement_nonattributed {
3878 | attribute switch_statement_nonattributed {
3879 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3880 parseContext.handleSwitchAttributes(*$1, $2);
3885 switch_statement_nonattributed
3886 : SWITCH LEFT_PAREN expression RIGHT_PAREN {
3887 // start new switch sequence on the switch stack
3888 ++parseContext.controlFlowNestingLevel;
3889 ++parseContext.statementNestingLevel;
3890 parseContext.switchSequenceStack.push_back(new TIntermSequence);
3891 parseContext.switchLevel.push_back(parseContext.statementNestingLevel);
3892 parseContext.symbolTable.push();
3894 LEFT_BRACE switch_statement_list RIGHT_BRACE {
3895 $$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0);
3896 delete parseContext.switchSequenceStack.back();
3897 parseContext.switchSequenceStack.pop_back();
3898 parseContext.switchLevel.pop_back();
3899 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3900 --parseContext.statementNestingLevel;
3901 --parseContext.controlFlowNestingLevel;
3905 switch_statement_list
3915 : CASE expression COLON {
3917 if (parseContext.switchLevel.size() == 0)
3918 parseContext.error($1.loc, "cannot appear outside switch statement", "case", "");
3919 else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
3920 parseContext.error($1.loc, "cannot be nested inside control flow", "case", "");
3922 parseContext.constantValueCheck($2, "case");
3923 parseContext.integerCheck($2, "case");
3924 $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc);
3929 if (parseContext.switchLevel.size() == 0)
3930 parseContext.error($1.loc, "cannot appear outside switch statement", "default", "");
3931 else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
3932 parseContext.error($1.loc, "cannot be nested inside control flow", "default", "");
3934 $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc);
3939 : iteration_statement_nonattributed {
3943 | attribute iteration_statement_nonattributed {
3944 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3945 parseContext.handleLoopAttributes(*$1, $2);
3950 iteration_statement_nonattributed
3951 : WHILE LEFT_PAREN {
3952 if (! parseContext.limits.whileLoops)
3953 parseContext.error($1.loc, "while loops not available", "limitation", "");
3954 parseContext.symbolTable.push();
3955 ++parseContext.loopNestingLevel;
3956 ++parseContext.statementNestingLevel;
3957 ++parseContext.controlFlowNestingLevel;
3959 condition RIGHT_PAREN statement_no_new_scope {
3960 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3961 $$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.loc);
3962 --parseContext.loopNestingLevel;
3963 --parseContext.statementNestingLevel;
3964 --parseContext.controlFlowNestingLevel;
3967 parseContext.symbolTable.push();
3968 ++parseContext.loopNestingLevel;
3969 ++parseContext.statementNestingLevel;
3970 ++parseContext.controlFlowNestingLevel;
3972 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON {
3973 if (! parseContext.limits.whileLoops)
3974 parseContext.error($1.loc, "do-while loops not available", "limitation", "");
3976 parseContext.boolCheck($8.loc, $6);
3978 $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc);
3979 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3980 --parseContext.loopNestingLevel;
3981 --parseContext.statementNestingLevel;
3982 --parseContext.controlFlowNestingLevel;
3985 parseContext.symbolTable.push();
3986 ++parseContext.loopNestingLevel;
3987 ++parseContext.statementNestingLevel;
3988 ++parseContext.controlFlowNestingLevel;
3990 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope {
3991 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3992 $$ = parseContext.intermediate.makeAggregate($4, $2.loc);
3993 TIntermLoop* forLoop = parseContext.intermediate.addLoop($7, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), true, $1.loc);
3994 if (! parseContext.limits.nonInductiveForLoops)
3995 parseContext.inductiveLoopCheck($1.loc, $4, forLoop);
3996 $$ = parseContext.intermediate.growAggregate($$, forLoop, $1.loc);
3997 $$->getAsAggregate()->setOperator(EOpSequence);
3998 --parseContext.loopNestingLevel;
3999 --parseContext.statementNestingLevel;
4000 --parseContext.controlFlowNestingLevel;
4005 : expression_statement {
4008 | declaration_statement {
4017 | /* May be null */ {
4023 : conditionopt SEMICOLON {
4027 | conditionopt SEMICOLON expression {
4034 : CONTINUE SEMICOLON {
4035 if (parseContext.loopNestingLevel <= 0)
4036 parseContext.error($1.loc, "continue statement only allowed in loops", "", "");
4037 $$ = parseContext.intermediate.addBranch(EOpContinue, $1.loc);
4040 if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0)
4041 parseContext.error($1.loc, "break statement only allowed in switch and loops", "", "");
4042 $$ = parseContext.intermediate.addBranch(EOpBreak, $1.loc);
4044 | RETURN SEMICOLON {
4045 $$ = parseContext.intermediate.addBranch(EOpReturn, $1.loc);
4046 if (parseContext.currentFunctionType->getBasicType() != EbtVoid)
4047 parseContext.error($1.loc, "non-void function must return a value", "return", "");
4048 if (parseContext.inMain)
4049 parseContext.postEntryPointReturn = true;
4051 | RETURN expression SEMICOLON {
4052 $$ = parseContext.handleReturnValue($1.loc, $2);
4054 | DISCARD SEMICOLON {
4055 parseContext.requireStage($1.loc, EShLangFragment, "discard");
4056 $$ = parseContext.intermediate.addBranch(EOpKill, $1.loc);
4058 | TERMINATE_INVOCATION SEMICOLON {
4059 parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
4060 $$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
4063 | TERMINATE_RAY SEMICOLON {
4064 parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
4065 $$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
4067 | IGNORE_INTERSECTION SEMICOLON {
4068 parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
4069 $$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
4074 // Grammar Note: No 'goto'. Gotos are not supported.
4077 : external_declaration {
4079 parseContext.intermediate.setTreeRoot($$);
4081 | translation_unit external_declaration {
4082 if ($2 != nullptr) {
4083 $$ = parseContext.intermediate.growAggregate($1, $2);
4084 parseContext.intermediate.setTreeRoot($$);
4089 external_declaration
4090 : function_definition {
4098 parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
4099 parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
4106 : function_prototype {
4107 $1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */);
4108 $1.intermNode = parseContext.handleFunctionDefinition($1.loc, *$1.function);
4110 // For ES 100 only, according to ES shading language 100 spec: A function
4111 // body has a scope nested inside the function's definition.
4112 if (parseContext.profile == EEsProfile && parseContext.version == 100)
4114 parseContext.symbolTable.push();
4115 ++parseContext.statementNestingLevel;
4118 compound_statement_no_new_scope {
4119 // May be best done as post process phase on intermediate code
4120 if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
4121 parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str());
4122 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
4123 $$ = parseContext.intermediate.growAggregate($1.intermNode, $3);
4124 parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc);
4125 $$->getAsAggregate()->setName($1.function->getMangledName().c_str());
4127 // store the pragma information for debug and optimize and other vendor specific
4128 // information. This information can be queried from the parse tree
4129 $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
4130 $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
4131 $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable);
4133 // Set currentFunctionType to empty pointer when goes outside of the function
4134 parseContext.currentFunctionType = nullptr;
4136 // For ES 100 only, according to ES shading language 100 spec: A function
4137 // body has a scope nested inside the function's definition.
4138 if (parseContext.profile == EEsProfile && parseContext.version == 100)
4140 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
4141 --parseContext.statementNestingLevel;
4148 : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
4153 : single_attribute {
4156 | attribute_list COMMA single_attribute {
4157 $$ = parseContext.mergeAttributes($1, $3);
4162 $$ = parseContext.makeAttributes(*$1.string);
4164 | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN {
4165 $$ = parseContext.makeAttributes(*$1.string, $3);
4170 spirv_requirements_list
4171 : spirv_requirements_parameter {
4174 | spirv_requirements_list COMMA spirv_requirements_parameter {
4175 $$ = parseContext.mergeSpirvRequirements($2.loc, $1, $3);
4178 spirv_requirements_parameter
4179 : IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET {
4180 $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, $4->getAsAggregate(), nullptr);
4182 | IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET {
4183 $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, nullptr, $4->getAsAggregate());
4186 spirv_extension_list
4188 $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
4190 | spirv_extension_list COMMA STRING_LITERAL {
4191 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
4194 spirv_capability_list
4196 $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.i, $1.loc, true));
4198 | spirv_capability_list COMMA INTCONSTANT {
4199 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.i, $3.loc, true));
4202 spirv_execution_mode_qualifier
4203 : SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN {
4204 parseContext.intermediate.insertSpirvExecutionMode($3.i);
4207 | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
4208 parseContext.intermediate.insertSpirvRequirement($3);
4209 parseContext.intermediate.insertSpirvExecutionMode($5.i);
4212 | SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
4213 parseContext.intermediate.insertSpirvExecutionMode($3.i, $5->getAsAggregate());
4216 | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
4217 parseContext.intermediate.insertSpirvRequirement($3);
4218 parseContext.intermediate.insertSpirvExecutionMode($5.i, $7->getAsAggregate());
4221 | SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
4222 parseContext.intermediate.insertSpirvExecutionModeId($3.i, $5->getAsAggregate());
4225 | SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
4226 parseContext.intermediate.insertSpirvRequirement($3);
4227 parseContext.intermediate.insertSpirvExecutionModeId($5.i, $7->getAsAggregate());
4231 spirv_execution_mode_parameter_list
4232 : spirv_execution_mode_parameter {
4233 $$ = parseContext.intermediate.makeAggregate($1);
4235 | spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter {
4236 $$ = parseContext.intermediate.growAggregate($1, $3);
4239 spirv_execution_mode_parameter
4241 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
4244 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
4247 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
4250 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
4253 $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
4256 spirv_execution_mode_id_parameter_list
4257 : constant_expression {
4258 if ($1->getBasicType() != EbtFloat &&
4259 $1->getBasicType() != EbtInt &&
4260 $1->getBasicType() != EbtUint &&
4261 $1->getBasicType() != EbtBool &&
4262 $1->getBasicType() != EbtString)
4263 parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
4264 $$ = parseContext.intermediate.makeAggregate($1);
4266 | spirv_execution_mode_id_parameter_list COMMA constant_expression {
4267 if ($3->getBasicType() != EbtFloat &&
4268 $3->getBasicType() != EbtInt &&
4269 $3->getBasicType() != EbtUint &&
4270 $3->getBasicType() != EbtBool &&
4271 $3->getBasicType() != EbtString)
4272 parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
4273 $$ = parseContext.intermediate.growAggregate($1, $3);
4276 spirv_storage_class_qualifier
4277 : SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN {
4279 $$.qualifier.storage = EvqSpirvStorageClass;
4280 $$.qualifier.spirvStorageClass = $3.i;
4282 | SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
4284 parseContext.intermediate.insertSpirvRequirement($3);
4285 $$.qualifier.storage = EvqSpirvStorageClass;
4286 $$.qualifier.spirvStorageClass = $5.i;
4289 spirv_decorate_qualifier
4290 : SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN{
4292 $$.qualifier.setSpirvDecorate($3.i);
4294 | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN{
4296 parseContext.intermediate.insertSpirvRequirement($3);
4297 $$.qualifier.setSpirvDecorate($5.i);
4299 | SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
4301 $$.qualifier.setSpirvDecorate($3.i, $5->getAsAggregate());
4303 | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
4305 parseContext.intermediate.insertSpirvRequirement($3);
4306 $$.qualifier.setSpirvDecorate($5.i, $7->getAsAggregate());
4308 | SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
4310 $$.qualifier.setSpirvDecorateId($3.i, $5->getAsAggregate());
4312 | SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
4314 parseContext.intermediate.insertSpirvRequirement($3);
4315 $$.qualifier.setSpirvDecorateId($5.i, $7->getAsAggregate());
4317 | SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
4319 $$.qualifier.setSpirvDecorateString($3.i, $5->getAsAggregate());
4321 | SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
4323 parseContext.intermediate.insertSpirvRequirement($3);
4324 $$.qualifier.setSpirvDecorateString($5.i, $7->getAsAggregate());
4327 spirv_decorate_parameter_list
4328 : spirv_decorate_parameter {
4329 $$ = parseContext.intermediate.makeAggregate($1);
4331 | spirv_decorate_parameter_list COMMA spirv_decorate_parameter {
4332 $$ = parseContext.intermediate.growAggregate($1, $3);
4335 spirv_decorate_parameter
4337 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
4340 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
4343 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
4346 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
4349 spirv_decorate_id_parameter_list
4350 : constant_expression {
4351 if ($1->getBasicType() != EbtFloat &&
4352 $1->getBasicType() != EbtInt &&
4353 $1->getBasicType() != EbtUint &&
4354 $1->getBasicType() != EbtBool)
4355 parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
4356 $$ = parseContext.intermediate.makeAggregate($1);
4358 | spirv_decorate_id_parameter_list COMMA constant_expression {
4359 if ($3->getBasicType() != EbtFloat &&
4360 $3->getBasicType() != EbtInt &&
4361 $3->getBasicType() != EbtUint &&
4362 $3->getBasicType() != EbtBool)
4363 parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
4364 $$ = parseContext.intermediate.growAggregate($1, $3);
4367 spirv_decorate_string_parameter_list
4369 $$ = parseContext.intermediate.makeAggregate(
4370 parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
4372 | spirv_decorate_string_parameter_list COMMA STRING_LITERAL {
4373 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
4376 spirv_type_specifier
4377 : SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
4378 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4379 $$.setSpirvType(*$3, $5);
4381 | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
4382 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4383 parseContext.intermediate.insertSpirvRequirement($3);
4384 $$.setSpirvType(*$5, $7);
4386 | SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
4387 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4388 $$.setSpirvType(*$3);
4390 | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
4391 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4392 parseContext.intermediate.insertSpirvRequirement($3);
4393 $$.setSpirvType(*$5);
4396 spirv_type_parameter_list
4397 : spirv_type_parameter {
4400 | spirv_type_parameter_list COMMA spirv_type_parameter {
4401 $$ = parseContext.mergeSpirvTypeParameters($1, $3);
4404 spirv_type_parameter
4405 : constant_expression {
4406 $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion());
4409 spirv_instruction_qualifier
4410 : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
4413 | SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
4414 parseContext.intermediate.insertSpirvRequirement($3);
4418 spirv_instruction_qualifier_list
4419 : spirv_instruction_qualifier_id {
4422 | spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id {
4423 $$ = parseContext.mergeSpirvInstruction($2.loc, $1, $3);
4426 spirv_instruction_qualifier_id
4427 : IDENTIFIER EQUAL STRING_LITERAL {
4428 $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, *$3.string);
4430 | IDENTIFIER EQUAL INTCONSTANT {
4431 $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);