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:
62 m4_define(`GLSLANG_WEB_EXCLUDE_ON', `m4_ifdef(`GLSLANG_WEB', `m4_divert(`-1')')')
63 m4_define(`GLSLANG_WEB_EXCLUDE_OFF', `m4_ifdef(`GLSLANG_WEB', `m4_divert')')
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
180 GLSLANG_WEB_EXCLUDE_ON
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
215 // combined image/sampler
216 %token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
217 %token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
218 %token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
219 %token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
220 %token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
221 %token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
222 %token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY
223 %token <lex> SAMPLEREXTERNALOES
224 %token <lex> SAMPLEREXTERNAL2DY2YEXT
225 %token <lex> ISAMPLER1DARRAY USAMPLER1D USAMPLER1DARRAY
226 %token <lex> F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE
227 %token <lex> F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY
228 %token <lex> F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY
229 %token <lex> F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW
230 %token <lex> F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW
233 %token <lex> IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D
234 %token <lex> UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D
235 %token <lex> IMAGE2DRECT IIMAGE2DRECT UIMAGE2DRECT
236 %token <lex> IMAGECUBE IIMAGECUBE UIMAGECUBE
237 %token <lex> IMAGEBUFFER IIMAGEBUFFER UIMAGEBUFFER
238 %token <lex> IMAGE1DARRAY IIMAGE1DARRAY UIMAGE1DARRAY
239 %token <lex> IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY
240 %token <lex> IMAGECUBEARRAY IIMAGECUBEARRAY UIMAGECUBEARRAY
241 %token <lex> IMAGE2DMS IIMAGE2DMS UIMAGE2DMS
242 %token <lex> IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY
244 %token <lex> F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT
245 %token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
246 %token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
248 %token <lex> I64IMAGE1D U64IMAGE1D
249 %token <lex> I64IMAGE2D U64IMAGE2D
250 %token <lex> I64IMAGE3D U64IMAGE3D
251 %token <lex> I64IMAGE2DRECT U64IMAGE2DRECT
252 %token <lex> I64IMAGECUBE U64IMAGECUBE
253 %token <lex> I64IMAGEBUFFER U64IMAGEBUFFER
254 %token <lex> I64IMAGE1DARRAY U64IMAGE1DARRAY
255 %token <lex> I64IMAGE2DARRAY U64IMAGE2DARRAY
256 %token <lex> I64IMAGECUBEARRAY U64IMAGECUBEARRAY
257 %token <lex> I64IMAGE2DMS U64IMAGE2DMS
258 %token <lex> I64IMAGE2DMSARRAY U64IMAGE2DMSARRAY
260 // texture without sampler
261 %token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
262 %token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
263 %token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
264 %token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
265 %token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
266 %token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
267 %token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
269 %token <lex> F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE
270 %token <lex> F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY
271 %token <lex> F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY
274 %token <lex> SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS
275 %token <lex> F16SUBPASSINPUT F16SUBPASSINPUTMS
278 %token <lex> SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID
279 %token <lex> SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING
280 %token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
282 GLSLANG_WEB_EXCLUDE_OFF
284 %token <lex> LEFT_OP RIGHT_OP
285 %token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
286 %token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
287 %token <lex> MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
288 %token <lex> SUB_ASSIGN
289 %token <lex> STRING_LITERAL
291 %token <lex> LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT
292 %token <lex> COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT
293 %token <lex> LEFT_ANGLE RIGHT_ANGLE VERTICAL_BAR CARET AMPERSAND QUESTION
295 %token <lex> INVARIANT
296 %token <lex> HIGH_PRECISION MEDIUM_PRECISION LOW_PRECISION PRECISION
297 %token <lex> PACKED RESOURCE SUPERP
299 %token <lex> FLOATCONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
300 %token <lex> IDENTIFIER TYPE_NAME
301 %token <lex> CENTROID IN OUT INOUT
302 %token <lex> STRUCT VOID WHILE
303 %token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
304 %token <lex> TERMINATE_INVOCATION
305 %token <lex> TERMINATE_RAY IGNORE_INTERSECTION
306 %token <lex> UNIFORM SHARED BUFFER
307 %token <lex> FLAT SMOOTH LAYOUT
309 GLSLANG_WEB_EXCLUDE_ON
310 %token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
311 %token <lex> INT64CONSTANT UINT64CONSTANT
312 %token <lex> SUBROUTINE DEMOTE
313 %token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
314 %token <lex> PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT
315 %token <lex> PATCH SAMPLE NONUNIFORM
316 %token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
317 %token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
318 %token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
320 GLSLANG_WEB_EXCLUDE_OFF
322 %type <interm> assignment_operator unary_operator
323 %type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
324 %type <interm.intermTypedNode> expression integer_expression assignment_expression
325 %type <interm.intermTypedNode> unary_expression multiplicative_expression additive_expression
326 %type <interm.intermTypedNode> relational_expression equality_expression
327 %type <interm.intermTypedNode> conditional_expression constant_expression
328 %type <interm.intermTypedNode> logical_or_expression logical_xor_expression logical_and_expression
329 %type <interm.intermTypedNode> shift_expression and_expression exclusive_or_expression inclusive_or_expression
330 %type <interm.intermTypedNode> function_call initializer condition conditionopt
332 %type <interm.intermNode> translation_unit function_definition
333 %type <interm.intermNode> statement simple_statement
334 %type <interm.intermNode> statement_list switch_statement_list compound_statement
335 %type <interm.intermNode> declaration_statement selection_statement selection_statement_nonattributed expression_statement
336 %type <interm.intermNode> switch_statement switch_statement_nonattributed case_label
337 %type <interm.intermNode> declaration external_declaration
338 %type <interm.intermNode> for_init_statement compound_statement_no_new_scope
339 %type <interm.nodePair> selection_rest_statement for_rest_statement
340 %type <interm.intermNode> iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped
341 %type <interm> single_declaration init_declarator_list
343 %type <interm> parameter_declaration parameter_declarator parameter_type_specifier
345 %type <interm> array_specifier
346 %type <interm.type> invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier
347 %type <interm.type> layout_qualifier layout_qualifier_id_list layout_qualifier_id
349 %type <interm.typeParameters> type_parameter_specifier
350 %type <interm.typeParameters> type_parameter_specifier_opt
351 %type <interm.typeParameters> type_parameter_specifier_list
353 %type <interm.type> type_qualifier fully_specified_type type_specifier
354 %type <interm.type> single_type_qualifier
355 %type <interm.type> type_specifier_nonarray
356 %type <interm.type> struct_specifier
357 %type <interm.typeLine> struct_declarator
358 %type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list
359 %type <interm> block_structure
360 %type <interm.function> function_header function_declarator
361 %type <interm.function> function_header_with_parameters
362 %type <interm> function_call_header_with_parameters function_call_header_no_parameters function_call_generic function_prototype
363 %type <interm> function_call_or_method function_identifier function_call_header
365 %type <interm.identifierList> identifier_list
367 GLSLANG_WEB_EXCLUDE_ON
368 %type <interm.type> precise_qualifier non_uniform_qualifier
369 %type <interm.typeList> type_name_list
370 %type <interm.attributes> attribute attribute_list single_attribute
371 %type <interm.intermNode> demote_statement
372 %type <interm.intermTypedNode> initializer_list
373 %type <interm.spirvReq> spirv_requirements_list spirv_requirements_parameter
374 %type <interm.intermNode> spirv_extension_list spirv_capability_list
375 %type <interm.intermNode> spirv_execution_mode_qualifier
376 %type <interm.intermNode> spirv_execution_mode_parameter_list spirv_execution_mode_parameter spirv_execution_mode_id_parameter_list
377 %type <interm.type> spirv_storage_class_qualifier
378 %type <interm.type> spirv_decorate_qualifier
379 %type <interm.intermNode> spirv_decorate_parameter_list spirv_decorate_parameter
380 %type <interm.intermNode> spirv_decorate_id_parameter_list
381 %type <interm.intermNode> spirv_decorate_string_parameter_list
382 %type <interm.type> spirv_type_specifier
383 %type <interm.spirvTypeParams> spirv_type_parameter_list spirv_type_parameter
384 %type <interm.spirvInst> spirv_instruction_qualifier
385 %type <interm.spirvInst> spirv_instruction_qualifier_list spirv_instruction_qualifier_id
386 GLSLANG_WEB_EXCLUDE_OFF
388 %start translation_unit
393 $$ = parseContext.handleVariable($1.loc, $1.symbol, $1.string);
398 : variable_identifier {
401 | LEFT_PAREN expression RIGHT_PAREN {
403 if ($$->getAsConstantUnion())
404 $$->getAsConstantUnion()->setExpression();
407 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
410 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
413 parseContext.fullIntegerCheck($1.loc, "unsigned literal");
414 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
417 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
419 GLSLANG_WEB_EXCLUDE_ON
421 $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
424 parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
425 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
428 parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
429 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
432 parseContext.int64Check($1.loc, "64-bit integer literal");
433 $$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true);
436 parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
437 $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
440 parseContext.explicitInt16Check($1.loc, "16-bit integer literal");
441 $$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true);
444 parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal");
445 $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
448 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal");
449 if (! parseContext.symbolTable.atBuiltInLevel())
450 parseContext.doubleCheck($1.loc, "double literal");
451 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
454 parseContext.float16Check($1.loc, "half float literal");
455 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
457 GLSLANG_WEB_EXCLUDE_OFF
461 : primary_expression {
464 | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET {
465 $$ = parseContext.handleBracketDereference($2.loc, $1, $3);
470 | postfix_expression DOT IDENTIFIER {
471 $$ = parseContext.handleDotDereference($3.loc, $1, *$3.string);
473 | postfix_expression INC_OP {
474 parseContext.variableCheck($1);
475 parseContext.lValueErrorCheck($2.loc, "++", $1);
476 $$ = parseContext.handleUnaryMath($2.loc, "++", EOpPostIncrement, $1);
478 | postfix_expression DEC_OP {
479 parseContext.variableCheck($1);
480 parseContext.lValueErrorCheck($2.loc, "--", $1);
481 $$ = parseContext.handleUnaryMath($2.loc, "--", EOpPostDecrement, $1);
487 parseContext.integerCheck($1, "[]");
493 : function_call_or_method {
494 $$ = parseContext.handleFunctionCall($1.loc, $1.function, $1.intermNode);
499 function_call_or_method
500 : function_call_generic {
505 function_call_generic
506 : function_call_header_with_parameters RIGHT_PAREN {
510 | function_call_header_no_parameters RIGHT_PAREN {
516 function_call_header_no_parameters
517 : function_call_header VOID {
520 | function_call_header {
525 function_call_header_with_parameters
526 : function_call_header assignment_expression {
527 TParameter param = { 0, new TType };
528 param.type->shallowCopy($2->getType());
529 $1.function->addParameter(param);
530 $$.function = $1.function;
533 | function_call_header_with_parameters COMMA assignment_expression {
534 TParameter param = { 0, new TType };
535 param.type->shallowCopy($3->getType());
536 $1.function->addParameter(param);
537 $$.function = $1.function;
538 $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc);
543 : function_identifier LEFT_PAREN {
548 // Grammar Note: Constructors look like functions, but are recognized as types.
554 $$.function = parseContext.handleConstructorCall($1.loc, $1);
556 | postfix_expression {
558 // Should be a method or subroutine call, but we haven't recognized the arguments yet.
563 TIntermMethod* method = $1->getAsMethodNode();
565 $$.function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength);
566 $$.intermNode = method->getObject();
568 TIntermSymbol* symbol = $1->getAsSymbolNode();
570 parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName());
571 TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid));
572 $$.function = function;
574 parseContext.error($1->getLoc(), "function call, method, or subroutine call expected", "", "");
577 if ($$.function == 0) {
579 TString* empty = NewPoolTString("");
580 $$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
583 GLSLANG_WEB_EXCLUDE_ON
584 | non_uniform_qualifier {
587 $$.function = parseContext.handleConstructorCall($1.loc, $1);
589 GLSLANG_WEB_EXCLUDE_OFF
593 : postfix_expression {
594 parseContext.variableCheck($1);
596 if (TIntermMethod* method = $1->getAsMethodNode())
597 parseContext.error($1->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), "");
599 | INC_OP unary_expression {
600 parseContext.lValueErrorCheck($1.loc, "++", $2);
601 $$ = parseContext.handleUnaryMath($1.loc, "++", EOpPreIncrement, $2);
603 | DEC_OP unary_expression {
604 parseContext.lValueErrorCheck($1.loc, "--", $2);
605 $$ = parseContext.handleUnaryMath($1.loc, "--", EOpPreDecrement, $2);
607 | unary_operator unary_expression {
608 if ($1.op != EOpNull) {
609 char errorOp[2] = {0, 0};
611 case EOpNegative: errorOp[0] = '-'; break;
612 case EOpLogicalNot: errorOp[0] = '!'; break;
613 case EOpBitwiseNot: errorOp[0] = '~'; break;
614 default: break; // some compilers want this
616 $$ = parseContext.handleUnaryMath($1.loc, errorOp, $1.op, $2);
619 if ($$->getAsConstantUnion())
620 $$->getAsConstantUnion()->setExpression();
624 // Grammar Note: No traditional style type casts.
627 : PLUS { $$.loc = $1.loc; $$.op = EOpNull; }
628 | DASH { $$.loc = $1.loc; $$.op = EOpNegative; }
629 | BANG { $$.loc = $1.loc; $$.op = EOpLogicalNot; }
630 | TILDE { $$.loc = $1.loc; $$.op = EOpBitwiseNot;
631 parseContext.fullIntegerCheck($1.loc, "bitwise not"); }
633 // Grammar Note: No '*' or '&' unary ops. Pointers are not supported.
635 multiplicative_expression
636 : unary_expression { $$ = $1; }
637 | multiplicative_expression STAR unary_expression {
638 $$ = parseContext.handleBinaryMath($2.loc, "*", EOpMul, $1, $3);
642 | multiplicative_expression SLASH unary_expression {
643 $$ = parseContext.handleBinaryMath($2.loc, "/", EOpDiv, $1, $3);
647 | multiplicative_expression PERCENT unary_expression {
648 parseContext.fullIntegerCheck($2.loc, "%");
649 $$ = parseContext.handleBinaryMath($2.loc, "%", EOpMod, $1, $3);
656 : multiplicative_expression { $$ = $1; }
657 | additive_expression PLUS multiplicative_expression {
658 $$ = parseContext.handleBinaryMath($2.loc, "+", EOpAdd, $1, $3);
662 | additive_expression DASH multiplicative_expression {
663 $$ = parseContext.handleBinaryMath($2.loc, "-", EOpSub, $1, $3);
670 : additive_expression { $$ = $1; }
671 | shift_expression LEFT_OP additive_expression {
672 parseContext.fullIntegerCheck($2.loc, "bit shift left");
673 $$ = parseContext.handleBinaryMath($2.loc, "<<", EOpLeftShift, $1, $3);
677 | shift_expression RIGHT_OP additive_expression {
678 parseContext.fullIntegerCheck($2.loc, "bit shift right");
679 $$ = parseContext.handleBinaryMath($2.loc, ">>", EOpRightShift, $1, $3);
685 relational_expression
686 : shift_expression { $$ = $1; }
687 | relational_expression LEFT_ANGLE shift_expression {
688 $$ = parseContext.handleBinaryMath($2.loc, "<", EOpLessThan, $1, $3);
690 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
692 | relational_expression RIGHT_ANGLE shift_expression {
693 $$ = parseContext.handleBinaryMath($2.loc, ">", EOpGreaterThan, $1, $3);
695 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
697 | relational_expression LE_OP shift_expression {
698 $$ = parseContext.handleBinaryMath($2.loc, "<=", EOpLessThanEqual, $1, $3);
700 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
702 | relational_expression GE_OP shift_expression {
703 $$ = parseContext.handleBinaryMath($2.loc, ">=", EOpGreaterThanEqual, $1, $3);
705 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
710 : relational_expression { $$ = $1; }
711 | equality_expression EQ_OP relational_expression {
712 parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison");
713 parseContext.opaqueCheck($2.loc, $1->getType(), "==");
714 parseContext.specializationCheck($2.loc, $1->getType(), "==");
715 parseContext.referenceCheck($2.loc, $1->getType(), "==");
716 $$ = parseContext.handleBinaryMath($2.loc, "==", EOpEqual, $1, $3);
718 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
720 | equality_expression NE_OP relational_expression {
721 parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison");
722 parseContext.opaqueCheck($2.loc, $1->getType(), "!=");
723 parseContext.specializationCheck($2.loc, $1->getType(), "!=");
724 parseContext.referenceCheck($2.loc, $1->getType(), "!=");
725 $$ = parseContext.handleBinaryMath($2.loc, "!=", EOpNotEqual, $1, $3);
727 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
732 : equality_expression { $$ = $1; }
733 | and_expression AMPERSAND equality_expression {
734 parseContext.fullIntegerCheck($2.loc, "bitwise and");
735 $$ = parseContext.handleBinaryMath($2.loc, "&", EOpAnd, $1, $3);
741 exclusive_or_expression
742 : and_expression { $$ = $1; }
743 | exclusive_or_expression CARET and_expression {
744 parseContext.fullIntegerCheck($2.loc, "bitwise exclusive or");
745 $$ = parseContext.handleBinaryMath($2.loc, "^", EOpExclusiveOr, $1, $3);
751 inclusive_or_expression
752 : exclusive_or_expression { $$ = $1; }
753 | inclusive_or_expression VERTICAL_BAR exclusive_or_expression {
754 parseContext.fullIntegerCheck($2.loc, "bitwise inclusive or");
755 $$ = parseContext.handleBinaryMath($2.loc, "|", EOpInclusiveOr, $1, $3);
761 logical_and_expression
762 : inclusive_or_expression { $$ = $1; }
763 | logical_and_expression AND_OP inclusive_or_expression {
764 $$ = parseContext.handleBinaryMath($2.loc, "&&", EOpLogicalAnd, $1, $3);
766 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
770 logical_xor_expression
771 : logical_and_expression { $$ = $1; }
772 | logical_xor_expression XOR_OP logical_and_expression {
773 $$ = parseContext.handleBinaryMath($2.loc, "^^", EOpLogicalXor, $1, $3);
775 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
779 logical_or_expression
780 : logical_xor_expression { $$ = $1; }
781 | logical_or_expression OR_OP logical_xor_expression {
782 $$ = parseContext.handleBinaryMath($2.loc, "||", EOpLogicalOr, $1, $3);
784 $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
788 conditional_expression
789 : logical_or_expression { $$ = $1; }
790 | logical_or_expression QUESTION {
791 ++parseContext.controlFlowNestingLevel;
793 expression COLON assignment_expression {
794 --parseContext.controlFlowNestingLevel;
795 parseContext.boolCheck($2.loc, $1);
796 parseContext.rValueErrorCheck($2.loc, "?", $1);
797 parseContext.rValueErrorCheck($5.loc, ":", $4);
798 parseContext.rValueErrorCheck($5.loc, ":", $6);
799 $$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc);
801 parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $6->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
807 assignment_expression
808 : conditional_expression { $$ = $1; }
809 | unary_expression assignment_operator assignment_expression {
810 parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment");
811 parseContext.opaqueCheck($2.loc, $1->getType(), "=");
812 parseContext.storage16BitAssignmentCheck($2.loc, $1->getType(), "=");
813 parseContext.specializationCheck($2.loc, $1->getType(), "=");
814 parseContext.lValueErrorCheck($2.loc, "assign", $1);
815 parseContext.rValueErrorCheck($2.loc, "assign", $3);
816 $$ = parseContext.addAssign($2.loc, $2.op, $1, $3);
818 parseContext.assignError($2.loc, "assign", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
831 $$.op = EOpMulAssign;
835 $$.op = EOpDivAssign;
838 parseContext.fullIntegerCheck($1.loc, "%=");
840 $$.op = EOpModAssign;
844 $$.op = EOpAddAssign;
848 $$.op = EOpSubAssign;
851 parseContext.fullIntegerCheck($1.loc, "bit-shift left assign");
852 $$.loc = $1.loc; $$.op = EOpLeftShiftAssign;
855 parseContext.fullIntegerCheck($1.loc, "bit-shift right assign");
856 $$.loc = $1.loc; $$.op = EOpRightShiftAssign;
859 parseContext.fullIntegerCheck($1.loc, "bitwise-and assign");
860 $$.loc = $1.loc; $$.op = EOpAndAssign;
863 parseContext.fullIntegerCheck($1.loc, "bitwise-xor assign");
864 $$.loc = $1.loc; $$.op = EOpExclusiveOrAssign;
867 parseContext.fullIntegerCheck($1.loc, "bitwise-or assign");
868 $$.loc = $1.loc; $$.op = EOpInclusiveOrAssign;
873 : assignment_expression {
876 | expression COMMA assignment_expression {
877 parseContext.samplerConstructorLocationCheck($2.loc, ",", $3);
878 $$ = parseContext.intermediate.addComma($1, $3, $2.loc);
880 parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
887 : conditional_expression {
888 parseContext.constantValueCheck($1, "");
894 : function_prototype SEMICOLON {
895 parseContext.handleFunctionDeclarator($1.loc, *$1.function, true /* prototype */);
897 // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
899 GLSLANG_WEB_EXCLUDE_ON
900 | spirv_instruction_qualifier function_prototype SEMICOLON {
901 parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
902 $2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier
903 parseContext.handleFunctionDeclarator($2.loc, *$2.function, true /* prototype */);
905 // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
907 | spirv_execution_mode_qualifier SEMICOLON {
908 parseContext.globalCheck($2.loc, "SPIR-V execution mode qualifier");
909 parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
912 GLSLANG_WEB_EXCLUDE_OFF
913 | init_declarator_list SEMICOLON {
914 if ($1.intermNode && $1.intermNode->getAsAggregate())
915 $1.intermNode->getAsAggregate()->setOperator(EOpSequence);
918 | PRECISION precision_qualifier type_specifier SEMICOLON {
919 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "precision statement");
920 // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope
921 parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]);
922 parseContext.setDefaultPrecision($1.loc, $3, $2.qualifier.precision);
925 | block_structure SEMICOLON {
926 parseContext.declareBlock($1.loc, *$1.typeList);
929 | block_structure IDENTIFIER SEMICOLON {
930 parseContext.declareBlock($1.loc, *$1.typeList, $2.string);
933 | block_structure IDENTIFIER array_specifier SEMICOLON {
934 parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes);
937 | type_qualifier SEMICOLON {
938 parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
939 parseContext.updateStandaloneQualifierDefaults($1.loc, $1);
942 | type_qualifier IDENTIFIER SEMICOLON {
943 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
944 parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$2.string);
947 | type_qualifier IDENTIFIER identifier_list SEMICOLON {
948 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
949 $3->push_back($2.string);
950 parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$3);
956 : type_qualifier IDENTIFIER LEFT_BRACE { parseContext.nestedBlockCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
957 --parseContext.blockNestingLevel;
958 parseContext.blockName = $2.string;
959 parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
960 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
961 parseContext.currentBlockQualifier = $1.qualifier;
968 $$ = new TIdentifierList;
969 $$->push_back($2.string);
971 | identifier_list COMMA IDENTIFIER {
973 $$->push_back($3.string);
978 : function_declarator RIGHT_PAREN {
982 | function_declarator RIGHT_PAREN attribute {
985 parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
986 parseContext.handleFunctionAttributes($2.loc, *$3);
988 | attribute function_declarator RIGHT_PAREN {
991 parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
992 parseContext.handleFunctionAttributes($3.loc, *$1);
994 | attribute function_declarator RIGHT_PAREN attribute {
997 parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
998 parseContext.handleFunctionAttributes($3.loc, *$1);
999 parseContext.handleFunctionAttributes($3.loc, *$4);
1007 | function_header_with_parameters {
1013 function_header_with_parameters
1014 : function_header parameter_declaration {
1015 // Add the parameter
1017 if ($2.param.type->getBasicType() != EbtVoid)
1018 $1->addParameter($2.param);
1020 delete $2.param.type;
1022 | function_header_with_parameters COMMA parameter_declaration {
1024 // Only first parameter of one-parameter functions can be void
1025 // The check for named parameters not being void is done in parameter_declarator
1027 if ($3.param.type->getBasicType() == EbtVoid) {
1029 // This parameter > first is void
1031 parseContext.error($2.loc, "cannot be an argument type except for '(void)'", "void", "");
1032 delete $3.param.type;
1034 // Add the parameter
1036 $1->addParameter($3.param);
1042 : fully_specified_type IDENTIFIER LEFT_PAREN {
1043 if ($1.qualifier.storage != EvqGlobal && $1.qualifier.storage != EvqTemporary) {
1044 parseContext.error($2.loc, "no qualifiers allowed for function return",
1045 GetStorageQualifierString($1.qualifier.storage), "");
1048 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1050 // Add the function as a prototype after parsing it (we do not support recursion)
1051 TFunction *function;
1054 // Potentially rename shader entry point function. No-op most of the time.
1055 parseContext.renameShaderFunction($2.string);
1057 // Make the function
1058 function = new TFunction($2.string, type);
1063 parameter_declarator
1065 : type_specifier IDENTIFIER {
1066 if ($1.arraySizes) {
1067 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1068 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
1069 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1071 if ($1.basicType == EbtVoid) {
1072 parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), "");
1074 parseContext.reservedErrorCheck($2.loc, *$2.string);
1076 TParameter param = {$2.string, new TType($1)};
1080 | type_specifier IDENTIFIER array_specifier {
1081 if ($1.arraySizes) {
1082 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1083 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
1084 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1086 TType* type = new TType($1);
1087 type->transferArraySizes($3.arraySizes);
1088 type->copyArrayInnerSizes($1.arraySizes);
1090 parseContext.arrayOfArrayVersionCheck($2.loc, type->getArraySizes());
1091 parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes);
1092 parseContext.reservedErrorCheck($2.loc, *$2.string);
1094 TParameter param = { $2.string, type };
1101 parameter_declaration
1105 : type_qualifier parameter_declarator {
1107 if ($1.qualifier.precision != EpqNone)
1108 $$.param.type->getQualifier().precision = $1.qualifier.precision;
1109 parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1111 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
1112 parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
1113 parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type);
1116 | parameter_declarator {
1119 parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
1120 parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
1121 parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1126 | type_qualifier parameter_type_specifier {
1128 if ($1.qualifier.precision != EpqNone)
1129 $$.param.type->getQualifier().precision = $1.qualifier.precision;
1130 parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1132 parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
1133 parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
1134 parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type);
1136 | parameter_type_specifier {
1139 parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
1140 parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
1141 parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
1145 parameter_type_specifier
1147 TParameter param = { 0, new TType($1) };
1150 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
1154 init_declarator_list
1155 : single_declaration {
1158 | init_declarator_list COMMA IDENTIFIER {
1160 parseContext.declareVariable($3.loc, *$3.string, $1.type);
1162 | init_declarator_list COMMA IDENTIFIER array_specifier {
1164 parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes);
1166 | init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer {
1168 TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6);
1169 $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $5.loc);
1171 | init_declarator_list COMMA IDENTIFIER EQUAL initializer {
1173 TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5);
1174 $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $4.loc);
1179 : fully_specified_type {
1182 GLSLANG_WEB_EXCLUDE_ON
1183 parseContext.declareTypeDefaults($$.loc, $$.type);
1184 GLSLANG_WEB_EXCLUDE_OFF
1186 | fully_specified_type IDENTIFIER {
1189 parseContext.declareVariable($2.loc, *$2.string, $1);
1191 | fully_specified_type IDENTIFIER array_specifier {
1194 parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes);
1196 | fully_specified_type IDENTIFIER array_specifier EQUAL initializer {
1198 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5);
1199 $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $4.loc);
1201 | fully_specified_type IDENTIFIER EQUAL initializer {
1203 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
1204 $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $3.loc);
1207 // Grammar Note: No 'enum', or 'typedef'.
1209 fully_specified_type
1213 parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $$);
1214 if ($1.arraySizes) {
1215 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1216 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
1218 parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
1220 | type_qualifier type_specifier {
1221 parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
1222 parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2);
1224 if ($2.arraySizes) {
1225 parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
1226 parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
1229 if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier))
1230 $2.arraySizes = nullptr;
1232 parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
1233 $2.shaderQualifiers.merge($1.shaderQualifiers);
1234 parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
1235 parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
1239 if (! $$.qualifier.isInterpolation() &&
1240 ((parseContext.language == EShLangVertex && $$.qualifier.storage == EvqVaryingOut) ||
1241 (parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn)))
1242 $$.qualifier.smooth = true;
1248 parseContext.globalCheck($1.loc, "invariant");
1249 parseContext.profileRequires($$.loc, ENoProfile, 120, 0, "invariant");
1251 $$.qualifier.invariant = true;
1255 interpolation_qualifier
1257 parseContext.globalCheck($1.loc, "smooth");
1258 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "smooth");
1259 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "smooth");
1261 $$.qualifier.smooth = true;
1264 parseContext.globalCheck($1.loc, "flat");
1265 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "flat");
1266 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "flat");
1268 $$.qualifier.flat = true;
1270 GLSLANG_WEB_EXCLUDE_ON
1272 parseContext.globalCheck($1.loc, "noperspective");
1273 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
1274 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective");
1276 $$.qualifier.nopersp = true;
1278 | EXPLICITINTERPAMD {
1279 parseContext.globalCheck($1.loc, "__explicitInterpAMD");
1280 parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
1281 parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
1283 $$.qualifier.explicitInterp = true;
1286 parseContext.globalCheck($1.loc, "pervertexNV");
1287 parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
1288 parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
1289 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
1291 $$.qualifier.pervertexNV = true;
1294 parseContext.globalCheck($1.loc, "pervertexEXT");
1295 parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
1296 parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
1297 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
1299 $$.qualifier.pervertexEXT = true;
1302 // No need for profile version or extension check. Shader stage already checks both.
1303 parseContext.globalCheck($1.loc, "perprimitiveNV");
1304 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV");
1305 // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
1306 if (parseContext.language == EShLangFragment)
1307 parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
1309 $$.qualifier.perPrimitiveNV = true;
1312 // No need for profile version or extension check. Shader stage already checks both.
1313 parseContext.globalCheck($1.loc, "perprimitiveEXT");
1314 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT");
1315 // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
1316 if (parseContext.language == EShLangFragment)
1317 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT");
1319 $$.qualifier.perPrimitiveNV = true;
1322 // No need for profile version or extension check. Shader stage already checks both.
1323 parseContext.globalCheck($1.loc, "perviewNV");
1324 parseContext.requireStage($1.loc, EShLangMesh, "perviewNV");
1326 $$.qualifier.perViewNV = true;
1329 // No need for profile version or extension check. Shader stage already checks both.
1330 parseContext.globalCheck($1.loc, "taskNV");
1331 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV");
1333 $$.qualifier.perTaskNV = true;
1335 GLSLANG_WEB_EXCLUDE_OFF
1339 : LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN {
1344 layout_qualifier_id_list
1345 : layout_qualifier_id {
1348 | layout_qualifier_id_list COMMA layout_qualifier_id {
1350 $$.shaderQualifiers.merge($3.shaderQualifiers);
1351 parseContext.mergeObjectLayoutQualifiers($$.qualifier, $3.qualifier, false);
1357 parseContext.setLayoutQualifier($1.loc, $$, *$1.string);
1359 | IDENTIFIER EQUAL constant_expression {
1361 parseContext.setLayoutQualifier($1.loc, $$, *$1.string, $3);
1363 | SHARED { // because "shared" is both an identifier and a keyword
1365 TString strShared("shared");
1366 parseContext.setLayoutQualifier($1.loc, $$, strShared);
1370 GLSLANG_WEB_EXCLUDE_ON
1373 parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
1374 parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise");
1376 $$.qualifier.noContraction = true;
1379 GLSLANG_WEB_EXCLUDE_OFF
1382 : single_type_qualifier {
1385 | type_qualifier single_type_qualifier {
1387 if ($$.basicType == EbtVoid)
1388 $$.basicType = $2.basicType;
1390 $$.shaderQualifiers.merge($2.shaderQualifiers);
1391 parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false);
1395 single_type_qualifier
1396 : storage_qualifier {
1399 | layout_qualifier {
1402 | precision_qualifier {
1403 parseContext.checkPrecisionQualifier($1.loc, $1.qualifier.precision);
1406 | interpolation_qualifier {
1407 // allow inheritance of storage qualifier from block declaration
1410 | invariant_qualifier {
1411 // allow inheritance of storage qualifier from block declaration
1414 GLSLANG_WEB_EXCLUDE_ON
1415 | precise_qualifier {
1416 // allow inheritance of storage qualifier from block declaration
1419 | non_uniform_qualifier {
1422 | spirv_storage_class_qualifier {
1423 parseContext.globalCheck($1.loc, "spirv_storage_class");
1424 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier");
1427 | spirv_decorate_qualifier {
1428 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier");
1431 | SPIRV_BY_REFERENCE {
1432 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference");
1434 $$.qualifier.setSpirvByReference();
1437 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal");
1439 $$.qualifier.setSpirvLiteral();
1441 GLSLANG_WEB_EXCLUDE_OFF
1447 $$.qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant
1450 parseContext.globalCheck($1.loc, "inout");
1452 $$.qualifier.storage = EvqInOut;
1455 parseContext.globalCheck($1.loc, "in");
1457 // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later
1458 $$.qualifier.storage = EvqIn;
1461 parseContext.globalCheck($1.loc, "out");
1463 // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later
1464 $$.qualifier.storage = EvqOut;
1467 parseContext.profileRequires($1.loc, ENoProfile, 120, 0, "centroid");
1468 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "centroid");
1469 parseContext.globalCheck($1.loc, "centroid");
1471 $$.qualifier.centroid = true;
1474 parseContext.globalCheck($1.loc, "uniform");
1476 $$.qualifier.storage = EvqUniform;
1479 parseContext.globalCheck($1.loc, "shared");
1480 parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
1481 parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
1482 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
1484 $$.qualifier.storage = EvqShared;
1487 parseContext.globalCheck($1.loc, "buffer");
1489 $$.qualifier.storage = EvqBuffer;
1491 GLSLANG_WEB_EXCLUDE_ON
1493 parseContext.requireStage($1.loc, EShLangVertex, "attribute");
1494 parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
1495 parseContext.checkDeprecated($1.loc, ENoProfile, 130, "attribute");
1496 parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "attribute");
1497 parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "attribute");
1499 parseContext.globalCheck($1.loc, "attribute");
1502 $$.qualifier.storage = EvqVaryingIn;
1505 parseContext.checkDeprecated($1.loc, ENoProfile, 130, "varying");
1506 parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "varying");
1507 parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "varying");
1508 parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "varying");
1510 parseContext.globalCheck($1.loc, "varying");
1513 if (parseContext.language == EShLangVertex)
1514 $$.qualifier.storage = EvqVaryingOut;
1516 $$.qualifier.storage = EvqVaryingIn;
1519 parseContext.globalCheck($1.loc, "patch");
1520 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch");
1522 $$.qualifier.patch = true;
1525 parseContext.globalCheck($1.loc, "sample");
1527 $$.qualifier.sample = true;
1530 parseContext.globalCheck($1.loc, "hitAttributeNV");
1531 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
1532 | EShLangAnyHitMask), "hitAttributeNV");
1533 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV");
1535 $$.qualifier.storage = EvqHitAttr;
1538 parseContext.globalCheck($1.loc, "hitAttributeEXT");
1539 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
1540 | EShLangAnyHitMask), "hitAttributeEXT");
1541 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV");
1543 $$.qualifier.storage = EvqHitAttr;
1546 parseContext.globalCheck($1.loc, "rayPayloadNV");
1547 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
1548 EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV");
1549 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV");
1551 $$.qualifier.storage = EvqPayload;
1554 parseContext.globalCheck($1.loc, "rayPayloadEXT");
1555 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
1556 EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT");
1557 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT");
1559 $$.qualifier.storage = EvqPayload;
1562 parseContext.globalCheck($1.loc, "rayPayloadInNV");
1563 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
1564 EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV");
1565 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV");
1567 $$.qualifier.storage = EvqPayloadIn;
1570 parseContext.globalCheck($1.loc, "rayPayloadInEXT");
1571 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
1572 EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT");
1573 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT");
1575 $$.qualifier.storage = EvqPayloadIn;
1578 parseContext.globalCheck($1.loc, "callableDataNV");
1579 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
1580 EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV");
1581 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV");
1583 $$.qualifier.storage = EvqCallableData;
1586 parseContext.globalCheck($1.loc, "callableDataEXT");
1587 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
1588 EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT");
1589 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT");
1591 $$.qualifier.storage = EvqCallableData;
1594 parseContext.globalCheck($1.loc, "callableDataInNV");
1595 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV");
1596 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV");
1598 $$.qualifier.storage = EvqCallableDataIn;
1601 parseContext.globalCheck($1.loc, "callableDataInEXT");
1602 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT");
1603 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT");
1605 $$.qualifier.storage = EvqCallableDataIn;
1609 $$.qualifier.coherent = true;
1613 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent");
1614 $$.qualifier.devicecoherent = true;
1616 | QUEUEFAMILYCOHERENT {
1618 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent");
1619 $$.qualifier.queuefamilycoherent = true;
1621 | WORKGROUPCOHERENT {
1623 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent");
1624 $$.qualifier.workgroupcoherent = true;
1626 | SUBGROUPCOHERENT {
1628 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent");
1629 $$.qualifier.subgroupcoherent = true;
1633 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate");
1634 $$.qualifier.nonprivate = true;
1636 | SHADERCALLCOHERENT {
1638 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent");
1639 $$.qualifier.shadercallcoherent = true;
1643 $$.qualifier.volatil = true;
1647 $$.qualifier.restrict = true;
1651 $$.qualifier.readonly = true;
1655 $$.qualifier.writeonly = true;
1658 parseContext.spvRemoved($1.loc, "subroutine");
1659 parseContext.globalCheck($1.loc, "subroutine");
1660 parseContext.unimplemented($1.loc, "subroutine");
1663 | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN {
1664 parseContext.spvRemoved($1.loc, "subroutine");
1665 parseContext.globalCheck($1.loc, "subroutine");
1666 parseContext.unimplemented($1.loc, "subroutine");
1669 | TASKPAYLOADWORKGROUPEXT {
1670 // No need for profile version or extension check. Shader stage already checks both.
1671 parseContext.globalCheck($1.loc, "taskPayloadSharedEXT");
1672 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT ");
1674 $$.qualifier.storage = EvqtaskPayloadSharedEXT;
1676 GLSLANG_WEB_EXCLUDE_OFF
1679 GLSLANG_WEB_EXCLUDE_ON
1680 non_uniform_qualifier
1683 $$.qualifier.nonUniform = true;
1691 | type_name_list COMMA IDENTIFIER {
1692 // TODO: 4.0 semantics: subroutines
1693 // 1) make sure each identifier is a type declared earlier with SUBROUTINE
1694 // 2) save all of the identifiers for future comparison with the declared function
1697 GLSLANG_WEB_EXCLUDE_OFF
1700 : type_specifier_nonarray type_parameter_specifier_opt {
1702 $$.qualifier.precision = parseContext.getDefaultPrecision($$);
1703 $$.typeParameters = $2;
1705 | type_specifier_nonarray type_parameter_specifier_opt array_specifier {
1706 parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
1708 $$.qualifier.precision = parseContext.getDefaultPrecision($$);
1709 $$.typeParameters = $2;
1710 $$.arraySizes = $3.arraySizes;
1715 : LEFT_BRACKET RIGHT_BRACKET {
1717 $$.arraySizes = new TArraySizes;
1718 $$.arraySizes->addInnerSize();
1720 | LEFT_BRACKET conditional_expression RIGHT_BRACKET {
1722 $$.arraySizes = new TArraySizes;
1725 parseContext.arraySizeCheck($2->getLoc(), $2, size, "array size");
1726 $$.arraySizes->addInnerSize(size);
1728 | array_specifier LEFT_BRACKET RIGHT_BRACKET {
1730 $$.arraySizes->addInnerSize();
1732 | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET {
1736 parseContext.arraySizeCheck($3->getLoc(), $3, size, "array size");
1737 $$.arraySizes->addInnerSize(size);
1741 type_parameter_specifier_opt
1742 : type_parameter_specifier {
1745 | /* May be null */ {
1750 type_parameter_specifier
1751 : LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE {
1756 type_parameter_specifier_list
1757 : unary_expression {
1758 $$ = new TArraySizes;
1761 parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
1762 $$->addInnerSize(size);
1764 | type_parameter_specifier_list COMMA unary_expression {
1768 parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
1769 $$->addInnerSize(size);
1773 type_specifier_nonarray
1775 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1776 $$.basicType = EbtVoid;
1779 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1780 $$.basicType = EbtFloat;
1783 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1784 $$.basicType = EbtInt;
1787 parseContext.fullIntegerCheck($1.loc, "unsigned integer");
1788 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1789 $$.basicType = EbtUint;
1792 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1793 $$.basicType = EbtBool;
1796 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1797 $$.basicType = EbtFloat;
1801 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1802 $$.basicType = EbtFloat;
1806 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1807 $$.basicType = EbtFloat;
1811 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1812 $$.basicType = EbtBool;
1816 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1817 $$.basicType = EbtBool;
1821 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1822 $$.basicType = EbtBool;
1826 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1827 $$.basicType = EbtInt;
1831 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1832 $$.basicType = EbtInt;
1836 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1837 $$.basicType = EbtInt;
1841 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1842 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1843 $$.basicType = EbtUint;
1847 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1848 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1849 $$.basicType = EbtUint;
1853 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1854 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1855 $$.basicType = EbtUint;
1859 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1860 $$.basicType = EbtFloat;
1864 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1865 $$.basicType = EbtFloat;
1869 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1870 $$.basicType = EbtFloat;
1874 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1875 $$.basicType = EbtFloat;
1879 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1880 $$.basicType = EbtFloat;
1884 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1885 $$.basicType = EbtFloat;
1889 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1890 $$.basicType = EbtFloat;
1894 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1895 $$.basicType = EbtFloat;
1899 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1900 $$.basicType = EbtFloat;
1904 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1905 $$.basicType = EbtFloat;
1909 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1910 $$.basicType = EbtFloat;
1914 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1915 $$.basicType = EbtFloat;
1918 GLSLANG_WEB_EXCLUDE_ON
1920 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
1921 if (! parseContext.symbolTable.atBuiltInLevel())
1922 parseContext.doubleCheck($1.loc, "double");
1923 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1924 $$.basicType = EbtDouble;
1927 parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel());
1928 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1929 $$.basicType = EbtFloat16;
1932 parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel());
1933 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1934 $$.basicType = EbtFloat;
1937 parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel());
1938 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1939 $$.basicType = EbtDouble;
1942 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1943 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1944 $$.basicType = EbtInt8;
1947 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1948 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1949 $$.basicType = EbtUint8;
1952 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1953 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1954 $$.basicType = EbtInt16;
1957 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1958 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1959 $$.basicType = EbtUint16;
1962 parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1963 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1964 $$.basicType = EbtInt;
1967 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1968 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1969 $$.basicType = EbtUint;
1972 parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
1973 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1974 $$.basicType = EbtInt64;
1977 parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1978 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1979 $$.basicType = EbtUint64;
1982 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1983 if (! parseContext.symbolTable.atBuiltInLevel())
1984 parseContext.doubleCheck($1.loc, "double vector");
1985 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1986 $$.basicType = EbtDouble;
1990 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1991 if (! parseContext.symbolTable.atBuiltInLevel())
1992 parseContext.doubleCheck($1.loc, "double vector");
1993 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1994 $$.basicType = EbtDouble;
1998 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1999 if (! parseContext.symbolTable.atBuiltInLevel())
2000 parseContext.doubleCheck($1.loc, "double vector");
2001 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2002 $$.basicType = EbtDouble;
2006 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2007 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2008 $$.basicType = EbtFloat16;
2012 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2013 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2014 $$.basicType = EbtFloat16;
2018 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2019 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2020 $$.basicType = EbtFloat16;
2024 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2025 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2026 $$.basicType = EbtFloat;
2030 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2031 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2032 $$.basicType = EbtFloat;
2036 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2037 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2038 $$.basicType = EbtFloat;
2042 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2043 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2044 $$.basicType = EbtDouble;
2048 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2049 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2050 $$.basicType = EbtDouble;
2054 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2055 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2056 $$.basicType = EbtDouble;
2060 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2061 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2062 $$.basicType = EbtInt8;
2066 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2067 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2068 $$.basicType = EbtInt8;
2072 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2073 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2074 $$.basicType = EbtInt8;
2078 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2079 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2080 $$.basicType = EbtInt16;
2084 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2085 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2086 $$.basicType = EbtInt16;
2090 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2091 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2092 $$.basicType = EbtInt16;
2096 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2097 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2098 $$.basicType = EbtInt;
2102 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2103 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2104 $$.basicType = EbtInt;
2108 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2109 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2110 $$.basicType = EbtInt;
2114 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2115 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2116 $$.basicType = EbtInt64;
2120 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2121 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2122 $$.basicType = EbtInt64;
2126 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2127 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2128 $$.basicType = EbtInt64;
2132 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2133 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2134 $$.basicType = EbtUint8;
2138 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2139 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2140 $$.basicType = EbtUint8;
2144 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2145 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2146 $$.basicType = EbtUint8;
2150 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2151 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2152 $$.basicType = EbtUint16;
2156 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2157 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2158 $$.basicType = EbtUint16;
2162 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2163 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2164 $$.basicType = EbtUint16;
2168 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2169 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2170 $$.basicType = EbtUint;
2174 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2175 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2176 $$.basicType = EbtUint;
2180 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2181 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2182 $$.basicType = EbtUint;
2186 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2187 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2188 $$.basicType = EbtUint64;
2192 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2193 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2194 $$.basicType = EbtUint64;
2198 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2199 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2200 $$.basicType = EbtUint64;
2204 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2205 if (! parseContext.symbolTable.atBuiltInLevel())
2206 parseContext.doubleCheck($1.loc, "double matrix");
2207 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2208 $$.basicType = EbtDouble;
2212 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2213 if (! parseContext.symbolTable.atBuiltInLevel())
2214 parseContext.doubleCheck($1.loc, "double matrix");
2215 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2216 $$.basicType = EbtDouble;
2220 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2221 if (! parseContext.symbolTable.atBuiltInLevel())
2222 parseContext.doubleCheck($1.loc, "double matrix");
2223 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2224 $$.basicType = EbtDouble;
2228 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2229 if (! parseContext.symbolTable.atBuiltInLevel())
2230 parseContext.doubleCheck($1.loc, "double matrix");
2231 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2232 $$.basicType = EbtDouble;
2236 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2237 if (! parseContext.symbolTable.atBuiltInLevel())
2238 parseContext.doubleCheck($1.loc, "double matrix");
2239 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2240 $$.basicType = EbtDouble;
2244 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2245 if (! parseContext.symbolTable.atBuiltInLevel())
2246 parseContext.doubleCheck($1.loc, "double matrix");
2247 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2248 $$.basicType = EbtDouble;
2252 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2253 if (! parseContext.symbolTable.atBuiltInLevel())
2254 parseContext.doubleCheck($1.loc, "double matrix");
2255 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2256 $$.basicType = EbtDouble;
2260 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2261 if (! parseContext.symbolTable.atBuiltInLevel())
2262 parseContext.doubleCheck($1.loc, "double matrix");
2263 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2264 $$.basicType = EbtDouble;
2268 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2269 if (! parseContext.symbolTable.atBuiltInLevel())
2270 parseContext.doubleCheck($1.loc, "double matrix");
2271 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2272 $$.basicType = EbtDouble;
2276 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2277 if (! parseContext.symbolTable.atBuiltInLevel())
2278 parseContext.doubleCheck($1.loc, "double matrix");
2279 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2280 $$.basicType = EbtDouble;
2284 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2285 if (! parseContext.symbolTable.atBuiltInLevel())
2286 parseContext.doubleCheck($1.loc, "double matrix");
2287 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2288 $$.basicType = EbtDouble;
2292 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2293 if (! parseContext.symbolTable.atBuiltInLevel())
2294 parseContext.doubleCheck($1.loc, "double matrix");
2295 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2296 $$.basicType = EbtDouble;
2300 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2301 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2302 $$.basicType = EbtFloat16;
2306 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2307 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2308 $$.basicType = EbtFloat16;
2312 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2313 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2314 $$.basicType = EbtFloat16;
2318 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2319 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2320 $$.basicType = EbtFloat16;
2324 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2325 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2326 $$.basicType = EbtFloat16;
2330 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2331 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2332 $$.basicType = EbtFloat16;
2336 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2337 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2338 $$.basicType = EbtFloat16;
2342 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2343 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2344 $$.basicType = EbtFloat16;
2348 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2349 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2350 $$.basicType = EbtFloat16;
2354 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2355 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2356 $$.basicType = EbtFloat16;
2360 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2361 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2362 $$.basicType = EbtFloat16;
2366 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2367 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2368 $$.basicType = EbtFloat16;
2372 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2373 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2374 $$.basicType = EbtFloat;
2378 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2379 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2380 $$.basicType = EbtFloat;
2384 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2385 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2386 $$.basicType = EbtFloat;
2390 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2391 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2392 $$.basicType = EbtFloat;
2396 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2397 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2398 $$.basicType = EbtFloat;
2402 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2403 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2404 $$.basicType = EbtFloat;
2408 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2409 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2410 $$.basicType = EbtFloat;
2414 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2415 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2416 $$.basicType = EbtFloat;
2420 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2421 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2422 $$.basicType = EbtFloat;
2426 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2427 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2428 $$.basicType = EbtFloat;
2432 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2433 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2434 $$.basicType = EbtFloat;
2438 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2439 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2440 $$.basicType = EbtFloat;
2444 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2445 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2446 $$.basicType = EbtDouble;
2450 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2451 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2452 $$.basicType = EbtDouble;
2456 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2457 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2458 $$.basicType = EbtDouble;
2462 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2463 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2464 $$.basicType = EbtDouble;
2468 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2469 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2470 $$.basicType = EbtDouble;
2474 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2475 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2476 $$.basicType = EbtDouble;
2480 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2481 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2482 $$.basicType = EbtDouble;
2486 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2487 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2488 $$.basicType = EbtDouble;
2492 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2493 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2494 $$.basicType = EbtDouble;
2498 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2499 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2500 $$.basicType = EbtDouble;
2504 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2505 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2506 $$.basicType = EbtDouble;
2510 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2511 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2512 $$.basicType = EbtDouble;
2516 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2517 $$.basicType = EbtAccStruct;
2520 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2521 $$.basicType = EbtAccStruct;
2524 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2525 $$.basicType = EbtRayQuery;
2528 parseContext.vulkanRemoved($1.loc, "atomic counter types");
2529 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2530 $$.basicType = EbtAtomicUint;
2533 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2534 $$.basicType = EbtSampler;
2535 $$.sampler.set(EbtFloat, Esd1D);
2537 GLSLANG_WEB_EXCLUDE_OFF
2539 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2540 $$.basicType = EbtSampler;
2541 $$.sampler.set(EbtFloat, Esd2D);
2544 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2545 $$.basicType = EbtSampler;
2546 $$.sampler.set(EbtFloat, Esd3D);
2549 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2550 $$.basicType = EbtSampler;
2551 $$.sampler.set(EbtFloat, EsdCube);
2554 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2555 $$.basicType = EbtSampler;
2556 $$.sampler.set(EbtFloat, Esd2D, false, true);
2558 | SAMPLERCUBESHADOW {
2559 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2560 $$.basicType = EbtSampler;
2561 $$.sampler.set(EbtFloat, EsdCube, false, true);
2564 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2565 $$.basicType = EbtSampler;
2566 $$.sampler.set(EbtFloat, Esd2D, true);
2568 | SAMPLER2DARRAYSHADOW {
2569 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2570 $$.basicType = EbtSampler;
2571 $$.sampler.set(EbtFloat, Esd2D, true, true);
2573 GLSLANG_WEB_EXCLUDE_ON
2575 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2576 $$.basicType = EbtSampler;
2577 $$.sampler.set(EbtFloat, Esd1D, false, true);
2580 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2581 $$.basicType = EbtSampler;
2582 $$.sampler.set(EbtFloat, Esd1D, true);
2584 | SAMPLER1DARRAYSHADOW {
2585 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2586 $$.basicType = EbtSampler;
2587 $$.sampler.set(EbtFloat, Esd1D, true, true);
2589 | SAMPLERCUBEARRAY {
2590 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2591 $$.basicType = EbtSampler;
2592 $$.sampler.set(EbtFloat, EsdCube, true);
2594 | SAMPLERCUBEARRAYSHADOW {
2595 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2596 $$.basicType = EbtSampler;
2597 $$.sampler.set(EbtFloat, EsdCube, true, true);
2600 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2601 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2602 $$.basicType = EbtSampler;
2603 $$.sampler.set(EbtFloat16, Esd1D);
2606 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2607 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2608 $$.basicType = EbtSampler;
2609 $$.sampler.set(EbtFloat16, Esd2D);
2612 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2613 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2614 $$.basicType = EbtSampler;
2615 $$.sampler.set(EbtFloat16, Esd3D);
2618 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2619 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2620 $$.basicType = EbtSampler;
2621 $$.sampler.set(EbtFloat16, EsdCube);
2623 | F16SAMPLER1DSHADOW {
2624 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2625 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2626 $$.basicType = EbtSampler;
2627 $$.sampler.set(EbtFloat16, Esd1D, false, true);
2629 | F16SAMPLER2DSHADOW {
2630 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2631 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2632 $$.basicType = EbtSampler;
2633 $$.sampler.set(EbtFloat16, Esd2D, false, true);
2635 | F16SAMPLERCUBESHADOW {
2636 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2637 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2638 $$.basicType = EbtSampler;
2639 $$.sampler.set(EbtFloat16, EsdCube, false, true);
2641 | F16SAMPLER1DARRAY {
2642 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2643 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2644 $$.basicType = EbtSampler;
2645 $$.sampler.set(EbtFloat16, Esd1D, true);
2647 | F16SAMPLER2DARRAY {
2648 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2649 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2650 $$.basicType = EbtSampler;
2651 $$.sampler.set(EbtFloat16, Esd2D, true);
2653 | F16SAMPLER1DARRAYSHADOW {
2654 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2655 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2656 $$.basicType = EbtSampler;
2657 $$.sampler.set(EbtFloat16, Esd1D, true, true);
2659 | F16SAMPLER2DARRAYSHADOW {
2660 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2661 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2662 $$.basicType = EbtSampler;
2663 $$.sampler.set(EbtFloat16, Esd2D, true, true);
2665 | F16SAMPLERCUBEARRAY {
2666 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2667 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2668 $$.basicType = EbtSampler;
2669 $$.sampler.set(EbtFloat16, EsdCube, true);
2671 | F16SAMPLERCUBEARRAYSHADOW {
2672 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2673 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2674 $$.basicType = EbtSampler;
2675 $$.sampler.set(EbtFloat16, EsdCube, true, true);
2678 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2679 $$.basicType = EbtSampler;
2680 $$.sampler.set(EbtInt, Esd1D);
2682 GLSLANG_WEB_EXCLUDE_OFF
2684 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2685 $$.basicType = EbtSampler;
2686 $$.sampler.set(EbtInt, Esd2D);
2689 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2690 $$.basicType = EbtSampler;
2691 $$.sampler.set(EbtInt, Esd3D);
2694 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2695 $$.basicType = EbtSampler;
2696 $$.sampler.set(EbtInt, EsdCube);
2699 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2700 $$.basicType = EbtSampler;
2701 $$.sampler.set(EbtInt, Esd2D, true);
2704 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2705 $$.basicType = EbtSampler;
2706 $$.sampler.set(EbtUint, Esd2D);
2709 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2710 $$.basicType = EbtSampler;
2711 $$.sampler.set(EbtUint, Esd3D);
2714 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2715 $$.basicType = EbtSampler;
2716 $$.sampler.set(EbtUint, EsdCube);
2718 GLSLANG_WEB_EXCLUDE_ON
2720 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2721 $$.basicType = EbtSampler;
2722 $$.sampler.set(EbtInt, Esd1D, true);
2724 | ISAMPLERCUBEARRAY {
2725 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2726 $$.basicType = EbtSampler;
2727 $$.sampler.set(EbtInt, EsdCube, true);
2730 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2731 $$.basicType = EbtSampler;
2732 $$.sampler.set(EbtUint, Esd1D);
2735 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2736 $$.basicType = EbtSampler;
2737 $$.sampler.set(EbtUint, Esd1D, true);
2739 | USAMPLERCUBEARRAY {
2740 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2741 $$.basicType = EbtSampler;
2742 $$.sampler.set(EbtUint, EsdCube, true);
2744 | TEXTURECUBEARRAY {
2745 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2746 $$.basicType = EbtSampler;
2747 $$.sampler.setTexture(EbtFloat, EsdCube, true);
2749 | ITEXTURECUBEARRAY {
2750 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2751 $$.basicType = EbtSampler;
2752 $$.sampler.setTexture(EbtInt, EsdCube, true);
2754 | UTEXTURECUBEARRAY {
2755 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2756 $$.basicType = EbtSampler;
2757 $$.sampler.setTexture(EbtUint, EsdCube, true);
2759 GLSLANG_WEB_EXCLUDE_OFF
2761 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2762 $$.basicType = EbtSampler;
2763 $$.sampler.set(EbtUint, Esd2D, true);
2766 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2767 $$.basicType = EbtSampler;
2768 $$.sampler.setTexture(EbtFloat, Esd2D);
2771 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2772 $$.basicType = EbtSampler;
2773 $$.sampler.setTexture(EbtFloat, Esd3D);
2776 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2777 $$.basicType = EbtSampler;
2778 $$.sampler.setTexture(EbtFloat, Esd2D, true);
2781 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2782 $$.basicType = EbtSampler;
2783 $$.sampler.setTexture(EbtFloat, EsdCube);
2786 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2787 $$.basicType = EbtSampler;
2788 $$.sampler.setTexture(EbtInt, Esd2D);
2791 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2792 $$.basicType = EbtSampler;
2793 $$.sampler.setTexture(EbtInt, Esd3D);
2796 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2797 $$.basicType = EbtSampler;
2798 $$.sampler.setTexture(EbtInt, EsdCube);
2801 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2802 $$.basicType = EbtSampler;
2803 $$.sampler.setTexture(EbtInt, Esd2D, true);
2806 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2807 $$.basicType = EbtSampler;
2808 $$.sampler.setTexture(EbtUint, Esd2D);
2811 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2812 $$.basicType = EbtSampler;
2813 $$.sampler.setTexture(EbtUint, Esd3D);
2816 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2817 $$.basicType = EbtSampler;
2818 $$.sampler.setTexture(EbtUint, EsdCube);
2821 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2822 $$.basicType = EbtSampler;
2823 $$.sampler.setTexture(EbtUint, Esd2D, true);
2826 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2827 $$.basicType = EbtSampler;
2828 $$.sampler.setPureSampler(false);
2831 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2832 $$.basicType = EbtSampler;
2833 $$.sampler.setPureSampler(true);
2835 GLSLANG_WEB_EXCLUDE_ON
2837 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2838 $$.basicType = EbtSampler;
2839 $$.sampler.set(EbtFloat, EsdRect);
2841 | SAMPLER2DRECTSHADOW {
2842 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2843 $$.basicType = EbtSampler;
2844 $$.sampler.set(EbtFloat, EsdRect, false, true);
2846 | F16SAMPLER2DRECT {
2847 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2848 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2849 $$.basicType = EbtSampler;
2850 $$.sampler.set(EbtFloat16, EsdRect);
2852 | F16SAMPLER2DRECTSHADOW {
2853 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2854 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2855 $$.basicType = EbtSampler;
2856 $$.sampler.set(EbtFloat16, EsdRect, false, true);
2859 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2860 $$.basicType = EbtSampler;
2861 $$.sampler.set(EbtInt, EsdRect);
2864 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2865 $$.basicType = EbtSampler;
2866 $$.sampler.set(EbtUint, EsdRect);
2869 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2870 $$.basicType = EbtSampler;
2871 $$.sampler.set(EbtFloat, EsdBuffer);
2873 | F16SAMPLERBUFFER {
2874 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2875 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2876 $$.basicType = EbtSampler;
2877 $$.sampler.set(EbtFloat16, EsdBuffer);
2880 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2881 $$.basicType = EbtSampler;
2882 $$.sampler.set(EbtInt, EsdBuffer);
2885 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2886 $$.basicType = EbtSampler;
2887 $$.sampler.set(EbtUint, EsdBuffer);
2890 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2891 $$.basicType = EbtSampler;
2892 $$.sampler.set(EbtFloat, Esd2D, false, false, true);
2895 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2896 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2897 $$.basicType = EbtSampler;
2898 $$.sampler.set(EbtFloat16, Esd2D, false, false, true);
2901 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2902 $$.basicType = EbtSampler;
2903 $$.sampler.set(EbtInt, Esd2D, false, false, true);
2906 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2907 $$.basicType = EbtSampler;
2908 $$.sampler.set(EbtUint, Esd2D, false, false, true);
2910 | SAMPLER2DMSARRAY {
2911 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2912 $$.basicType = EbtSampler;
2913 $$.sampler.set(EbtFloat, Esd2D, true, false, true);
2915 | F16SAMPLER2DMSARRAY {
2916 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2917 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2918 $$.basicType = EbtSampler;
2919 $$.sampler.set(EbtFloat16, Esd2D, true, false, true);
2921 | ISAMPLER2DMSARRAY {
2922 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2923 $$.basicType = EbtSampler;
2924 $$.sampler.set(EbtInt, Esd2D, true, false, true);
2926 | USAMPLER2DMSARRAY {
2927 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2928 $$.basicType = EbtSampler;
2929 $$.sampler.set(EbtUint, Esd2D, true, false, true);
2932 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2933 $$.basicType = EbtSampler;
2934 $$.sampler.setTexture(EbtFloat, Esd1D);
2937 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2938 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2939 $$.basicType = EbtSampler;
2940 $$.sampler.setTexture(EbtFloat16, Esd1D);
2943 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2944 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2945 $$.basicType = EbtSampler;
2946 $$.sampler.setTexture(EbtFloat16, Esd2D);
2949 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2950 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2951 $$.basicType = EbtSampler;
2952 $$.sampler.setTexture(EbtFloat16, Esd3D);
2955 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2956 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2957 $$.basicType = EbtSampler;
2958 $$.sampler.setTexture(EbtFloat16, EsdCube);
2961 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2962 $$.basicType = EbtSampler;
2963 $$.sampler.setTexture(EbtFloat, Esd1D, true);
2965 | F16TEXTURE1DARRAY {
2966 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2967 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2968 $$.basicType = EbtSampler;
2969 $$.sampler.setTexture(EbtFloat16, Esd1D, true);
2971 | F16TEXTURE2DARRAY {
2972 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2973 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2974 $$.basicType = EbtSampler;
2975 $$.sampler.setTexture(EbtFloat16, Esd2D, true);
2977 | F16TEXTURECUBEARRAY {
2978 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2979 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2980 $$.basicType = EbtSampler;
2981 $$.sampler.setTexture(EbtFloat16, EsdCube, true);
2984 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2985 $$.basicType = EbtSampler;
2986 $$.sampler.setTexture(EbtInt, Esd1D);
2989 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2990 $$.basicType = EbtSampler;
2991 $$.sampler.setTexture(EbtInt, Esd1D, true);
2994 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2995 $$.basicType = EbtSampler;
2996 $$.sampler.setTexture(EbtUint, Esd1D);
2999 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3000 $$.basicType = EbtSampler;
3001 $$.sampler.setTexture(EbtUint, Esd1D, true);
3004 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3005 $$.basicType = EbtSampler;
3006 $$.sampler.setTexture(EbtFloat, EsdRect);
3008 | F16TEXTURE2DRECT {
3009 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3010 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3011 $$.basicType = EbtSampler;
3012 $$.sampler.setTexture(EbtFloat16, EsdRect);
3015 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3016 $$.basicType = EbtSampler;
3017 $$.sampler.setTexture(EbtInt, EsdRect);
3020 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3021 $$.basicType = EbtSampler;
3022 $$.sampler.setTexture(EbtUint, EsdRect);
3025 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3026 $$.basicType = EbtSampler;
3027 $$.sampler.setTexture(EbtFloat, EsdBuffer);
3029 | F16TEXTUREBUFFER {
3030 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3031 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3032 $$.basicType = EbtSampler;
3033 $$.sampler.setTexture(EbtFloat16, EsdBuffer);
3036 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3037 $$.basicType = EbtSampler;
3038 $$.sampler.setTexture(EbtInt, EsdBuffer);
3041 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3042 $$.basicType = EbtSampler;
3043 $$.sampler.setTexture(EbtUint, EsdBuffer);
3046 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3047 $$.basicType = EbtSampler;
3048 $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true);
3051 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3052 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3053 $$.basicType = EbtSampler;
3054 $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true);
3057 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3058 $$.basicType = EbtSampler;
3059 $$.sampler.setTexture(EbtInt, Esd2D, false, false, true);
3062 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3063 $$.basicType = EbtSampler;
3064 $$.sampler.setTexture(EbtUint, Esd2D, false, false, true);
3066 | TEXTURE2DMSARRAY {
3067 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3068 $$.basicType = EbtSampler;
3069 $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true);
3071 | F16TEXTURE2DMSARRAY {
3072 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3073 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3074 $$.basicType = EbtSampler;
3075 $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true);
3077 | ITEXTURE2DMSARRAY {
3078 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3079 $$.basicType = EbtSampler;
3080 $$.sampler.setTexture(EbtInt, Esd2D, true, false, true);
3082 | UTEXTURE2DMSARRAY {
3083 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3084 $$.basicType = EbtSampler;
3085 $$.sampler.setTexture(EbtUint, Esd2D, true, false, true);
3088 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3089 $$.basicType = EbtSampler;
3090 $$.sampler.setImage(EbtFloat, Esd1D);
3093 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3094 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3095 $$.basicType = EbtSampler;
3096 $$.sampler.setImage(EbtFloat16, Esd1D);
3099 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3100 $$.basicType = EbtSampler;
3101 $$.sampler.setImage(EbtInt, Esd1D);
3104 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3105 $$.basicType = EbtSampler;
3106 $$.sampler.setImage(EbtUint, Esd1D);
3109 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3110 $$.basicType = EbtSampler;
3111 $$.sampler.setImage(EbtFloat, Esd2D);
3114 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3115 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3116 $$.basicType = EbtSampler;
3117 $$.sampler.setImage(EbtFloat16, Esd2D);
3120 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3121 $$.basicType = EbtSampler;
3122 $$.sampler.setImage(EbtInt, Esd2D);
3125 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3126 $$.basicType = EbtSampler;
3127 $$.sampler.setImage(EbtUint, Esd2D);
3130 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3131 $$.basicType = EbtSampler;
3132 $$.sampler.setImage(EbtFloat, Esd3D);
3135 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3136 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3137 $$.basicType = EbtSampler;
3138 $$.sampler.setImage(EbtFloat16, Esd3D);
3141 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3142 $$.basicType = EbtSampler;
3143 $$.sampler.setImage(EbtInt, Esd3D);
3146 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3147 $$.basicType = EbtSampler;
3148 $$.sampler.setImage(EbtUint, Esd3D);
3151 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3152 $$.basicType = EbtSampler;
3153 $$.sampler.setImage(EbtFloat, EsdRect);
3156 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3157 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3158 $$.basicType = EbtSampler;
3159 $$.sampler.setImage(EbtFloat16, EsdRect);
3162 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3163 $$.basicType = EbtSampler;
3164 $$.sampler.setImage(EbtInt, EsdRect);
3167 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3168 $$.basicType = EbtSampler;
3169 $$.sampler.setImage(EbtUint, EsdRect);
3172 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3173 $$.basicType = EbtSampler;
3174 $$.sampler.setImage(EbtFloat, EsdCube);
3177 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3178 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3179 $$.basicType = EbtSampler;
3180 $$.sampler.setImage(EbtFloat16, EsdCube);
3183 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3184 $$.basicType = EbtSampler;
3185 $$.sampler.setImage(EbtInt, EsdCube);
3188 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3189 $$.basicType = EbtSampler;
3190 $$.sampler.setImage(EbtUint, EsdCube);
3193 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3194 $$.basicType = EbtSampler;
3195 $$.sampler.setImage(EbtFloat, EsdBuffer);
3198 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3199 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3200 $$.basicType = EbtSampler;
3201 $$.sampler.setImage(EbtFloat16, EsdBuffer);
3204 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3205 $$.basicType = EbtSampler;
3206 $$.sampler.setImage(EbtInt, EsdBuffer);
3209 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3210 $$.basicType = EbtSampler;
3211 $$.sampler.setImage(EbtUint, EsdBuffer);
3214 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3215 $$.basicType = EbtSampler;
3216 $$.sampler.setImage(EbtFloat, Esd1D, true);
3219 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3220 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3221 $$.basicType = EbtSampler;
3222 $$.sampler.setImage(EbtFloat16, Esd1D, true);
3225 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3226 $$.basicType = EbtSampler;
3227 $$.sampler.setImage(EbtInt, Esd1D, true);
3230 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3231 $$.basicType = EbtSampler;
3232 $$.sampler.setImage(EbtUint, Esd1D, true);
3235 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3236 $$.basicType = EbtSampler;
3237 $$.sampler.setImage(EbtFloat, Esd2D, true);
3240 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3241 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3242 $$.basicType = EbtSampler;
3243 $$.sampler.setImage(EbtFloat16, Esd2D, true);
3246 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3247 $$.basicType = EbtSampler;
3248 $$.sampler.setImage(EbtInt, Esd2D, true);
3251 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3252 $$.basicType = EbtSampler;
3253 $$.sampler.setImage(EbtUint, Esd2D, true);
3256 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3257 $$.basicType = EbtSampler;
3258 $$.sampler.setImage(EbtFloat, EsdCube, true);
3260 | F16IMAGECUBEARRAY {
3261 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3262 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3263 $$.basicType = EbtSampler;
3264 $$.sampler.setImage(EbtFloat16, EsdCube, true);
3267 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3268 $$.basicType = EbtSampler;
3269 $$.sampler.setImage(EbtInt, EsdCube, true);
3272 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3273 $$.basicType = EbtSampler;
3274 $$.sampler.setImage(EbtUint, EsdCube, true);
3277 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3278 $$.basicType = EbtSampler;
3279 $$.sampler.setImage(EbtFloat, Esd2D, false, false, true);
3282 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3283 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3284 $$.basicType = EbtSampler;
3285 $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true);
3288 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3289 $$.basicType = EbtSampler;
3290 $$.sampler.setImage(EbtInt, Esd2D, false, false, true);
3293 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3294 $$.basicType = EbtSampler;
3295 $$.sampler.setImage(EbtUint, Esd2D, false, false, true);
3298 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3299 $$.basicType = EbtSampler;
3300 $$.sampler.setImage(EbtFloat, Esd2D, true, false, true);
3302 | F16IMAGE2DMSARRAY {
3303 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3304 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3305 $$.basicType = EbtSampler;
3306 $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true);
3309 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3310 $$.basicType = EbtSampler;
3311 $$.sampler.setImage(EbtInt, Esd2D, true, false, true);
3314 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3315 $$.basicType = EbtSampler;
3316 $$.sampler.setImage(EbtUint, Esd2D, true, false, true);
3319 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3320 $$.basicType = EbtSampler;
3321 $$.sampler.setImage(EbtInt64, Esd1D);
3324 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3325 $$.basicType = EbtSampler;
3326 $$.sampler.setImage(EbtUint64, Esd1D);
3329 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3330 $$.basicType = EbtSampler;
3331 $$.sampler.setImage(EbtInt64, Esd2D);
3334 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3335 $$.basicType = EbtSampler;
3336 $$.sampler.setImage(EbtUint64, Esd2D);
3339 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3340 $$.basicType = EbtSampler;
3341 $$.sampler.setImage(EbtInt64, Esd3D);
3344 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3345 $$.basicType = EbtSampler;
3346 $$.sampler.setImage(EbtUint64, Esd3D);
3349 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3350 $$.basicType = EbtSampler;
3351 $$.sampler.setImage(EbtInt64, EsdRect);
3354 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3355 $$.basicType = EbtSampler;
3356 $$.sampler.setImage(EbtUint64, EsdRect);
3359 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3360 $$.basicType = EbtSampler;
3361 $$.sampler.setImage(EbtInt64, EsdCube);
3364 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3365 $$.basicType = EbtSampler;
3366 $$.sampler.setImage(EbtUint64, EsdCube);
3369 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3370 $$.basicType = EbtSampler;
3371 $$.sampler.setImage(EbtInt64, EsdBuffer);
3374 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3375 $$.basicType = EbtSampler;
3376 $$.sampler.setImage(EbtUint64, EsdBuffer);
3379 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3380 $$.basicType = EbtSampler;
3381 $$.sampler.setImage(EbtInt64, Esd1D, true);
3384 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3385 $$.basicType = EbtSampler;
3386 $$.sampler.setImage(EbtUint64, Esd1D, true);
3389 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3390 $$.basicType = EbtSampler;
3391 $$.sampler.setImage(EbtInt64, Esd2D, true);
3394 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3395 $$.basicType = EbtSampler;
3396 $$.sampler.setImage(EbtUint64, Esd2D, true);
3398 | I64IMAGECUBEARRAY {
3399 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3400 $$.basicType = EbtSampler;
3401 $$.sampler.setImage(EbtInt64, EsdCube, true);
3403 | U64IMAGECUBEARRAY {
3404 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3405 $$.basicType = EbtSampler;
3406 $$.sampler.setImage(EbtUint64, EsdCube, true);
3409 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3410 $$.basicType = EbtSampler;
3411 $$.sampler.setImage(EbtInt64, Esd2D, false, false, true);
3414 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3415 $$.basicType = EbtSampler;
3416 $$.sampler.setImage(EbtUint64, Esd2D, false, false, true);
3418 | I64IMAGE2DMSARRAY {
3419 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3420 $$.basicType = EbtSampler;
3421 $$.sampler.setImage(EbtInt64, Esd2D, true, false, true);
3423 | U64IMAGE2DMSARRAY {
3424 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3425 $$.basicType = EbtSampler;
3426 $$.sampler.setImage(EbtUint64, Esd2D, true, false, true);
3428 | SAMPLEREXTERNALOES { // GL_OES_EGL_image_external
3429 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3430 $$.basicType = EbtSampler;
3431 $$.sampler.set(EbtFloat, Esd2D);
3432 $$.sampler.external = true;
3434 | SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target
3435 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3436 $$.basicType = EbtSampler;
3437 $$.sampler.set(EbtFloat, Esd2D);
3438 $$.sampler.yuv = true;
3441 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3442 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3443 $$.basicType = EbtSampler;
3444 $$.sampler.setSubpass(EbtFloat);
3447 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3448 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3449 $$.basicType = EbtSampler;
3450 $$.sampler.setSubpass(EbtFloat, true);
3453 parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
3454 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3455 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3456 $$.basicType = EbtSampler;
3457 $$.sampler.setSubpass(EbtFloat16);
3459 | F16SUBPASSINPUTMS {
3460 parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
3461 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3462 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3463 $$.basicType = EbtSampler;
3464 $$.sampler.setSubpass(EbtFloat16, true);
3467 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3468 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3469 $$.basicType = EbtSampler;
3470 $$.sampler.setSubpass(EbtInt);
3473 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3474 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3475 $$.basicType = EbtSampler;
3476 $$.sampler.setSubpass(EbtInt, true);
3479 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3480 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3481 $$.basicType = EbtSampler;
3482 $$.sampler.setSubpass(EbtUint);
3485 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3486 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3487 $$.basicType = EbtSampler;
3488 $$.sampler.setSubpass(EbtUint, true);
3491 parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3492 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3493 $$.basicType = EbtFloat;
3497 parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3498 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3499 $$.basicType = EbtInt;
3503 parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3504 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3505 $$.basicType = EbtUint;
3508 | spirv_type_specifier {
3509 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
3512 GLSLANG_WEB_EXCLUDE_OFF
3513 | struct_specifier {
3515 $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3516 parseContext.structTypeCheck($$.loc, $$);
3520 // This is for user defined type names. The lexical phase looked up the
3523 if (const TVariable* variable = ($1.symbol)->getAsVariable()) {
3524 const TType& structure = variable->getType();
3525 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3526 $$.basicType = EbtStruct;
3527 $$.userDef = &structure;
3529 parseContext.error($1.loc, "expected type name", $1.string->c_str(), "");
3535 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "highp precision qualifier");
3536 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3537 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqHigh);
3539 | MEDIUM_PRECISION {
3540 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "mediump precision qualifier");
3541 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3542 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqMedium);
3545 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "lowp precision qualifier");
3546 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3547 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqLow);
3552 : STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
3553 TType* structure = new TType($5, *$2.string);
3554 parseContext.structArrayCheck($2.loc, *structure);
3555 TVariable* userTypeDef = new TVariable($2.string, *structure, true);
3556 if (! parseContext.symbolTable.insert(*userTypeDef))
3557 parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct");
3559 $$.basicType = EbtStruct;
3560 $$.userDef = structure;
3561 --parseContext.structNestingLevel;
3563 | STRUCT LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
3564 TType* structure = new TType($4, TString(""));
3566 $$.basicType = EbtStruct;
3567 $$.userDef = structure;
3568 --parseContext.structNestingLevel;
3572 struct_declaration_list
3573 : struct_declaration {
3576 | struct_declaration_list struct_declaration {
3578 for (unsigned int i = 0; i < $2->size(); ++i) {
3579 for (unsigned int j = 0; j < $$->size(); ++j) {
3580 if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName())
3581 parseContext.error((*$2)[i].loc, "duplicate member name:", "", (*$2)[i].type->getFieldName().c_str());
3583 $$->push_back((*$2)[i]);
3589 : type_specifier struct_declarator_list SEMICOLON {
3590 if ($1.arraySizes) {
3591 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
3592 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
3593 if (parseContext.isEsProfile())
3594 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
3599 parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
3600 parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
3602 for (unsigned int i = 0; i < $$->size(); ++i) {
3604 type.setFieldName((*$$)[i].type->getFieldName());
3605 type.transferArraySizes((*$$)[i].type->getArraySizes());
3606 type.copyArrayInnerSizes($1.arraySizes);
3607 parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
3608 (*$$)[i].type->shallowCopy(type);
3611 | type_qualifier type_specifier struct_declarator_list SEMICOLON {
3612 if ($2.arraySizes) {
3613 parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
3614 parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
3615 if (parseContext.isEsProfile())
3616 parseContext.arraySizeRequiredCheck($2.loc, *$2.arraySizes);
3621 parseContext.memberQualifierCheck($1);
3622 parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
3623 parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
3624 parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
3626 for (unsigned int i = 0; i < $$->size(); ++i) {
3628 type.setFieldName((*$$)[i].type->getFieldName());
3629 type.transferArraySizes((*$$)[i].type->getArraySizes());
3630 type.copyArrayInnerSizes($2.arraySizes);
3631 parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
3632 (*$$)[i].type->shallowCopy(type);
3637 struct_declarator_list
3638 : struct_declarator {
3642 | struct_declarator_list COMMA struct_declarator {
3649 $$.type = new TType(EbtVoid);
3651 $$.type->setFieldName(*$1.string);
3653 | IDENTIFIER array_specifier {
3654 parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes);
3656 $$.type = new TType(EbtVoid);
3658 $$.type->setFieldName(*$1.string);
3659 $$.type->transferArraySizes($2.arraySizes);
3664 : assignment_expression {
3667 GLSLANG_WEB_EXCLUDE_ON
3668 | LEFT_BRACE initializer_list RIGHT_BRACE {
3669 const char* initFeature = "{ } style initializers";
3670 parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
3671 parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
3674 | LEFT_BRACE initializer_list COMMA RIGHT_BRACE {
3675 const char* initFeature = "{ } style initializers";
3676 parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
3677 parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
3680 | LEFT_BRACE RIGHT_BRACE {
3681 const char* initFeature = "empty { } initializer";
3682 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
3683 parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
3684 $$ = parseContext.intermediate.makeAggregate($1.loc);
3686 GLSLANG_WEB_EXCLUDE_OFF
3689 GLSLANG_WEB_EXCLUDE_ON
3692 $$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
3694 | initializer_list COMMA initializer {
3695 $$ = parseContext.intermediate.growAggregate($1, $3);
3698 GLSLANG_WEB_EXCLUDE_OFF
3700 declaration_statement
3701 : declaration { $$ = $1; }
3705 : compound_statement { $$ = $1; }
3706 | simple_statement { $$ = $1; }
3709 // Grammar Note: labeled statements for switch statements only; 'goto' is not supported.
3712 : declaration_statement { $$ = $1; }
3713 | expression_statement { $$ = $1; }
3714 | selection_statement { $$ = $1; }
3715 | switch_statement { $$ = $1; }
3716 | case_label { $$ = $1; }
3717 | iteration_statement { $$ = $1; }
3718 | jump_statement { $$ = $1; }
3719 GLSLANG_WEB_EXCLUDE_ON
3720 | demote_statement { $$ = $1; }
3721 GLSLANG_WEB_EXCLUDE_OFF
3724 GLSLANG_WEB_EXCLUDE_ON
3726 : DEMOTE SEMICOLON {
3727 parseContext.requireStage($1.loc, EShLangFragment, "demote");
3728 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote");
3729 $$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc);
3732 GLSLANG_WEB_EXCLUDE_OFF
3735 : LEFT_BRACE RIGHT_BRACE { $$ = 0; }
3737 parseContext.symbolTable.push();
3738 ++parseContext.statementNestingLevel;
3741 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3742 --parseContext.statementNestingLevel;
3745 if ($3 && $3->getAsAggregate())
3746 $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
3751 statement_no_new_scope
3752 : compound_statement_no_new_scope { $$ = $1; }
3753 | simple_statement { $$ = $1; }
3758 ++parseContext.controlFlowNestingLevel;
3760 compound_statement {
3761 --parseContext.controlFlowNestingLevel;
3765 parseContext.symbolTable.push();
3766 ++parseContext.statementNestingLevel;
3767 ++parseContext.controlFlowNestingLevel;
3770 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3771 --parseContext.statementNestingLevel;
3772 --parseContext.controlFlowNestingLevel;
3776 compound_statement_no_new_scope
3777 // Statement that doesn't create a new scope, for selection_statement, iteration_statement
3778 : LEFT_BRACE RIGHT_BRACE {
3781 | LEFT_BRACE statement_list RIGHT_BRACE {
3782 if ($2 && $2->getAsAggregate())
3783 $2->getAsAggregate()->setOperator(EOpSequence);
3790 $$ = parseContext.intermediate.makeAggregate($1);
3791 if ($1 && $1->getAsBranchNode() && ($1->getAsBranchNode()->getFlowOp() == EOpCase ||
3792 $1->getAsBranchNode()->getFlowOp() == EOpDefault)) {
3793 parseContext.wrapupSwitchSubsequence(0, $1);
3794 $$ = 0; // start a fresh subsequence for what's after this case
3797 | statement_list statement {
3798 if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase ||
3799 $2->getAsBranchNode()->getFlowOp() == EOpDefault)) {
3800 parseContext.wrapupSwitchSubsequence($1 ? $1->getAsAggregate() : 0, $2);
3801 $$ = 0; // start a fresh subsequence for what's after this case
3803 $$ = parseContext.intermediate.growAggregate($1, $2);
3807 expression_statement
3808 : SEMICOLON { $$ = 0; }
3809 | expression SEMICOLON { $$ = static_cast<TIntermNode*>($1); }
3813 : selection_statement_nonattributed {
3816 GLSLANG_WEB_EXCLUDE_ON
3817 | attribute selection_statement_nonattributed {
3818 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3819 parseContext.handleSelectionAttributes(*$1, $2);
3822 GLSLANG_WEB_EXCLUDE_OFF
3824 selection_statement_nonattributed
3825 : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
3826 parseContext.boolCheck($1.loc, $3);
3827 $$ = parseContext.intermediate.addSelection($3, $5, $1.loc);
3831 selection_rest_statement
3832 : statement_scoped ELSE statement_scoped {
3836 | statement_scoped {
3843 // In 1996 c++ draft, conditions can include single declarations
3846 parseContext.boolCheck($1->getLoc(), $1);
3848 | fully_specified_type IDENTIFIER EQUAL initializer {
3849 parseContext.boolCheck($2.loc, $1);
3852 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
3854 $$ = initNode->getAsTyped();
3861 : switch_statement_nonattributed {
3864 GLSLANG_WEB_EXCLUDE_ON
3865 | attribute switch_statement_nonattributed {
3866 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3867 parseContext.handleSwitchAttributes(*$1, $2);
3870 GLSLANG_WEB_EXCLUDE_OFF
3872 switch_statement_nonattributed
3873 : SWITCH LEFT_PAREN expression RIGHT_PAREN {
3874 // start new switch sequence on the switch stack
3875 ++parseContext.controlFlowNestingLevel;
3876 ++parseContext.statementNestingLevel;
3877 parseContext.switchSequenceStack.push_back(new TIntermSequence);
3878 parseContext.switchLevel.push_back(parseContext.statementNestingLevel);
3879 parseContext.symbolTable.push();
3881 LEFT_BRACE switch_statement_list RIGHT_BRACE {
3882 $$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0);
3883 delete parseContext.switchSequenceStack.back();
3884 parseContext.switchSequenceStack.pop_back();
3885 parseContext.switchLevel.pop_back();
3886 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3887 --parseContext.statementNestingLevel;
3888 --parseContext.controlFlowNestingLevel;
3892 switch_statement_list
3902 : CASE expression COLON {
3904 if (parseContext.switchLevel.size() == 0)
3905 parseContext.error($1.loc, "cannot appear outside switch statement", "case", "");
3906 else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
3907 parseContext.error($1.loc, "cannot be nested inside control flow", "case", "");
3909 parseContext.constantValueCheck($2, "case");
3910 parseContext.integerCheck($2, "case");
3911 $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc);
3916 if (parseContext.switchLevel.size() == 0)
3917 parseContext.error($1.loc, "cannot appear outside switch statement", "default", "");
3918 else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
3919 parseContext.error($1.loc, "cannot be nested inside control flow", "default", "");
3921 $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc);
3926 : iteration_statement_nonattributed {
3929 GLSLANG_WEB_EXCLUDE_ON
3930 | attribute iteration_statement_nonattributed {
3931 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3932 parseContext.handleLoopAttributes(*$1, $2);
3935 GLSLANG_WEB_EXCLUDE_OFF
3937 iteration_statement_nonattributed
3938 : WHILE LEFT_PAREN {
3939 if (! parseContext.limits.whileLoops)
3940 parseContext.error($1.loc, "while loops not available", "limitation", "");
3941 parseContext.symbolTable.push();
3942 ++parseContext.loopNestingLevel;
3943 ++parseContext.statementNestingLevel;
3944 ++parseContext.controlFlowNestingLevel;
3946 condition RIGHT_PAREN statement_no_new_scope {
3947 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3948 $$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.loc);
3949 --parseContext.loopNestingLevel;
3950 --parseContext.statementNestingLevel;
3951 --parseContext.controlFlowNestingLevel;
3954 parseContext.symbolTable.push();
3955 ++parseContext.loopNestingLevel;
3956 ++parseContext.statementNestingLevel;
3957 ++parseContext.controlFlowNestingLevel;
3959 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON {
3960 if (! parseContext.limits.whileLoops)
3961 parseContext.error($1.loc, "do-while loops not available", "limitation", "");
3963 parseContext.boolCheck($8.loc, $6);
3965 $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc);
3966 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3967 --parseContext.loopNestingLevel;
3968 --parseContext.statementNestingLevel;
3969 --parseContext.controlFlowNestingLevel;
3972 parseContext.symbolTable.push();
3973 ++parseContext.loopNestingLevel;
3974 ++parseContext.statementNestingLevel;
3975 ++parseContext.controlFlowNestingLevel;
3977 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope {
3978 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3979 $$ = parseContext.intermediate.makeAggregate($4, $2.loc);
3980 TIntermLoop* forLoop = parseContext.intermediate.addLoop($7, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), true, $1.loc);
3981 if (! parseContext.limits.nonInductiveForLoops)
3982 parseContext.inductiveLoopCheck($1.loc, $4, forLoop);
3983 $$ = parseContext.intermediate.growAggregate($$, forLoop, $1.loc);
3984 $$->getAsAggregate()->setOperator(EOpSequence);
3985 --parseContext.loopNestingLevel;
3986 --parseContext.statementNestingLevel;
3987 --parseContext.controlFlowNestingLevel;
3992 : expression_statement {
3995 | declaration_statement {
4004 | /* May be null */ {
4010 : conditionopt SEMICOLON {
4014 | conditionopt SEMICOLON expression {
4021 : CONTINUE SEMICOLON {
4022 if (parseContext.loopNestingLevel <= 0)
4023 parseContext.error($1.loc, "continue statement only allowed in loops", "", "");
4024 $$ = parseContext.intermediate.addBranch(EOpContinue, $1.loc);
4027 if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0)
4028 parseContext.error($1.loc, "break statement only allowed in switch and loops", "", "");
4029 $$ = parseContext.intermediate.addBranch(EOpBreak, $1.loc);
4031 | RETURN SEMICOLON {
4032 $$ = parseContext.intermediate.addBranch(EOpReturn, $1.loc);
4033 if (parseContext.currentFunctionType->getBasicType() != EbtVoid)
4034 parseContext.error($1.loc, "non-void function must return a value", "return", "");
4035 if (parseContext.inMain)
4036 parseContext.postEntryPointReturn = true;
4038 | RETURN expression SEMICOLON {
4039 $$ = parseContext.handleReturnValue($1.loc, $2);
4041 | DISCARD SEMICOLON {
4042 parseContext.requireStage($1.loc, EShLangFragment, "discard");
4043 $$ = parseContext.intermediate.addBranch(EOpKill, $1.loc);
4045 | TERMINATE_INVOCATION SEMICOLON {
4046 parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
4047 $$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
4049 GLSLANG_WEB_EXCLUDE_ON
4050 | TERMINATE_RAY SEMICOLON {
4051 parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
4052 $$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
4054 | IGNORE_INTERSECTION SEMICOLON {
4055 parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
4056 $$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
4058 GLSLANG_WEB_EXCLUDE_OFF
4061 // Grammar Note: No 'goto'. Gotos are not supported.
4064 : external_declaration {
4066 parseContext.intermediate.setTreeRoot($$);
4068 | translation_unit external_declaration {
4069 if ($2 != nullptr) {
4070 $$ = parseContext.intermediate.growAggregate($1, $2);
4071 parseContext.intermediate.setTreeRoot($$);
4076 external_declaration
4077 : function_definition {
4083 GLSLANG_WEB_EXCLUDE_ON
4085 parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
4086 parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
4089 GLSLANG_WEB_EXCLUDE_OFF
4093 : function_prototype {
4094 $1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */);
4095 $1.intermNode = parseContext.handleFunctionDefinition($1.loc, *$1.function);
4097 // For ES 100 only, according to ES shading language 100 spec: A function
4098 // body has a scope nested inside the function's definition.
4099 if (parseContext.profile == EEsProfile && parseContext.version == 100)
4101 parseContext.symbolTable.push();
4102 ++parseContext.statementNestingLevel;
4105 compound_statement_no_new_scope {
4106 // May be best done as post process phase on intermediate code
4107 if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
4108 parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str());
4109 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
4110 $$ = parseContext.intermediate.growAggregate($1.intermNode, $3);
4111 parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc);
4112 $$->getAsAggregate()->setName($1.function->getMangledName().c_str());
4114 // store the pragma information for debug and optimize and other vendor specific
4115 // information. This information can be queried from the parse tree
4116 $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
4117 $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
4118 $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable);
4120 // Set currentFunctionType to empty pointer when goes outside of the function
4121 parseContext.currentFunctionType = nullptr;
4123 // For ES 100 only, according to ES shading language 100 spec: A function
4124 // body has a scope nested inside the function's definition.
4125 if (parseContext.profile == EEsProfile && parseContext.version == 100)
4127 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
4128 --parseContext.statementNestingLevel;
4133 GLSLANG_WEB_EXCLUDE_ON
4135 : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
4140 : single_attribute {
4143 | attribute_list COMMA single_attribute {
4144 $$ = parseContext.mergeAttributes($1, $3);
4149 $$ = parseContext.makeAttributes(*$1.string);
4151 | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN {
4152 $$ = parseContext.makeAttributes(*$1.string, $3);
4154 GLSLANG_WEB_EXCLUDE_OFF
4156 GLSLANG_WEB_EXCLUDE_ON
4157 spirv_requirements_list
4158 : spirv_requirements_parameter {
4161 | spirv_requirements_list COMMA spirv_requirements_parameter {
4162 $$ = parseContext.mergeSpirvRequirements($2.loc, $1, $3);
4165 spirv_requirements_parameter
4166 : IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET {
4167 $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, $4->getAsAggregate(), nullptr);
4169 | IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET {
4170 $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, nullptr, $4->getAsAggregate());
4173 spirv_extension_list
4175 $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
4177 | spirv_extension_list COMMA STRING_LITERAL {
4178 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
4181 spirv_capability_list
4183 $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.i, $1.loc, true));
4185 | spirv_capability_list COMMA INTCONSTANT {
4186 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.i, $3.loc, true));
4189 spirv_execution_mode_qualifier
4190 : SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN {
4191 parseContext.intermediate.insertSpirvExecutionMode($3.i);
4194 | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
4195 parseContext.intermediate.insertSpirvRequirement($3);
4196 parseContext.intermediate.insertSpirvExecutionMode($5.i);
4199 | SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
4200 parseContext.intermediate.insertSpirvExecutionMode($3.i, $5->getAsAggregate());
4203 | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
4204 parseContext.intermediate.insertSpirvRequirement($3);
4205 parseContext.intermediate.insertSpirvExecutionMode($5.i, $7->getAsAggregate());
4208 | SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
4209 parseContext.intermediate.insertSpirvExecutionModeId($3.i, $5->getAsAggregate());
4212 | SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
4213 parseContext.intermediate.insertSpirvRequirement($3);
4214 parseContext.intermediate.insertSpirvExecutionModeId($5.i, $7->getAsAggregate());
4218 spirv_execution_mode_parameter_list
4219 : spirv_execution_mode_parameter {
4220 $$ = parseContext.intermediate.makeAggregate($1);
4222 | spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter {
4223 $$ = parseContext.intermediate.growAggregate($1, $3);
4226 spirv_execution_mode_parameter
4228 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
4231 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
4234 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
4237 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
4240 $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
4243 spirv_execution_mode_id_parameter_list
4244 : constant_expression {
4245 if ($1->getBasicType() != EbtFloat &&
4246 $1->getBasicType() != EbtInt &&
4247 $1->getBasicType() != EbtUint &&
4248 $1->getBasicType() != EbtBool &&
4249 $1->getBasicType() != EbtString)
4250 parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
4251 $$ = parseContext.intermediate.makeAggregate($1);
4253 | spirv_execution_mode_id_parameter_list COMMA constant_expression {
4254 if ($3->getBasicType() != EbtFloat &&
4255 $3->getBasicType() != EbtInt &&
4256 $3->getBasicType() != EbtUint &&
4257 $3->getBasicType() != EbtBool &&
4258 $3->getBasicType() != EbtString)
4259 parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
4260 $$ = parseContext.intermediate.growAggregate($1, $3);
4263 spirv_storage_class_qualifier
4264 : SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN {
4266 $$.qualifier.storage = EvqSpirvStorageClass;
4267 $$.qualifier.spirvStorageClass = $3.i;
4269 | SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
4271 parseContext.intermediate.insertSpirvRequirement($3);
4272 $$.qualifier.storage = EvqSpirvStorageClass;
4273 $$.qualifier.spirvStorageClass = $5.i;
4276 spirv_decorate_qualifier
4277 : SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN{
4279 $$.qualifier.setSpirvDecorate($3.i);
4281 | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN{
4283 parseContext.intermediate.insertSpirvRequirement($3);
4284 $$.qualifier.setSpirvDecorate($5.i);
4286 | SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
4288 $$.qualifier.setSpirvDecorate($3.i, $5->getAsAggregate());
4290 | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
4292 parseContext.intermediate.insertSpirvRequirement($3);
4293 $$.qualifier.setSpirvDecorate($5.i, $7->getAsAggregate());
4295 | SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
4297 $$.qualifier.setSpirvDecorateId($3.i, $5->getAsAggregate());
4299 | SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
4301 parseContext.intermediate.insertSpirvRequirement($3);
4302 $$.qualifier.setSpirvDecorateId($5.i, $7->getAsAggregate());
4304 | SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
4306 $$.qualifier.setSpirvDecorateString($3.i, $5->getAsAggregate());
4308 | SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
4310 parseContext.intermediate.insertSpirvRequirement($3);
4311 $$.qualifier.setSpirvDecorateString($5.i, $7->getAsAggregate());
4314 spirv_decorate_parameter_list
4315 : spirv_decorate_parameter {
4316 $$ = parseContext.intermediate.makeAggregate($1);
4318 | spirv_decorate_parameter_list COMMA spirv_decorate_parameter {
4319 $$ = parseContext.intermediate.growAggregate($1, $3);
4322 spirv_decorate_parameter
4324 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
4327 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
4330 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
4333 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
4336 spirv_decorate_id_parameter_list
4337 : constant_expression {
4338 if ($1->getBasicType() != EbtFloat &&
4339 $1->getBasicType() != EbtInt &&
4340 $1->getBasicType() != EbtUint &&
4341 $1->getBasicType() != EbtBool)
4342 parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
4343 $$ = parseContext.intermediate.makeAggregate($1);
4345 | spirv_decorate_id_parameter_list COMMA constant_expression {
4346 if ($3->getBasicType() != EbtFloat &&
4347 $3->getBasicType() != EbtInt &&
4348 $3->getBasicType() != EbtUint &&
4349 $3->getBasicType() != EbtBool)
4350 parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
4351 $$ = parseContext.intermediate.growAggregate($1, $3);
4354 spirv_decorate_string_parameter_list
4356 $$ = parseContext.intermediate.makeAggregate(
4357 parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
4359 | spirv_decorate_string_parameter_list COMMA STRING_LITERAL {
4360 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
4363 spirv_type_specifier
4364 : SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
4365 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4366 $$.setSpirvType(*$3, $5);
4368 | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
4369 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4370 parseContext.intermediate.insertSpirvRequirement($3);
4371 $$.setSpirvType(*$5, $7);
4373 | SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
4374 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4375 $$.setSpirvType(*$3);
4377 | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
4378 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4379 parseContext.intermediate.insertSpirvRequirement($3);
4380 $$.setSpirvType(*$5);
4383 spirv_type_parameter_list
4384 : spirv_type_parameter {
4387 | spirv_type_parameter_list COMMA spirv_type_parameter {
4388 $$ = parseContext.mergeSpirvTypeParameters($1, $3);
4391 spirv_type_parameter
4392 : constant_expression {
4393 $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion());
4396 spirv_instruction_qualifier
4397 : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
4400 | SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
4401 parseContext.intermediate.insertSpirvRequirement($3);
4405 spirv_instruction_qualifier_list
4406 : spirv_instruction_qualifier_id {
4409 | spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id {
4410 $$ = parseContext.mergeSpirvInstruction($2.loc, $1, $3);
4413 spirv_instruction_qualifier_id
4414 : IDENTIFIER EQUAL STRING_LITERAL {
4415 $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, *$3.string);
4417 | IDENTIFIER EQUAL INTCONSTANT {
4418 $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);
4420 GLSLANG_WEB_EXCLUDE_OFF