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
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 | EShLangMeshNVMask), "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, "perviewNV");
1314 parseContext.requireStage($1.loc, EShLangMeshNV, "perviewNV");
1316 $$.qualifier.perViewNV = true;
1319 // No need for profile version or extension check. Shader stage already checks both.
1320 parseContext.globalCheck($1.loc, "taskNV");
1321 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV");
1323 $$.qualifier.perTaskNV = true;
1325 GLSLANG_WEB_EXCLUDE_OFF
1329 : LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN {
1334 layout_qualifier_id_list
1335 : layout_qualifier_id {
1338 | layout_qualifier_id_list COMMA layout_qualifier_id {
1340 $$.shaderQualifiers.merge($3.shaderQualifiers);
1341 parseContext.mergeObjectLayoutQualifiers($$.qualifier, $3.qualifier, false);
1347 parseContext.setLayoutQualifier($1.loc, $$, *$1.string);
1349 | IDENTIFIER EQUAL constant_expression {
1351 parseContext.setLayoutQualifier($1.loc, $$, *$1.string, $3);
1353 | SHARED { // because "shared" is both an identifier and a keyword
1355 TString strShared("shared");
1356 parseContext.setLayoutQualifier($1.loc, $$, strShared);
1360 GLSLANG_WEB_EXCLUDE_ON
1363 parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
1364 parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise");
1366 $$.qualifier.noContraction = true;
1369 GLSLANG_WEB_EXCLUDE_OFF
1372 : single_type_qualifier {
1375 | type_qualifier single_type_qualifier {
1377 if ($$.basicType == EbtVoid)
1378 $$.basicType = $2.basicType;
1380 $$.shaderQualifiers.merge($2.shaderQualifiers);
1381 parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false);
1385 single_type_qualifier
1386 : storage_qualifier {
1389 | layout_qualifier {
1392 | precision_qualifier {
1393 parseContext.checkPrecisionQualifier($1.loc, $1.qualifier.precision);
1396 | interpolation_qualifier {
1397 // allow inheritance of storage qualifier from block declaration
1400 | invariant_qualifier {
1401 // allow inheritance of storage qualifier from block declaration
1404 GLSLANG_WEB_EXCLUDE_ON
1405 | precise_qualifier {
1406 // allow inheritance of storage qualifier from block declaration
1409 | non_uniform_qualifier {
1412 | spirv_storage_class_qualifier {
1413 parseContext.globalCheck($1.loc, "spirv_storage_class");
1414 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier");
1417 | spirv_decorate_qualifier {
1418 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier");
1421 | SPIRV_BY_REFERENCE {
1422 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference");
1424 $$.qualifier.setSpirvByReference();
1427 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal");
1429 $$.qualifier.setSpirvLiteral();
1431 GLSLANG_WEB_EXCLUDE_OFF
1437 $$.qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant
1440 parseContext.globalCheck($1.loc, "inout");
1442 $$.qualifier.storage = EvqInOut;
1445 parseContext.globalCheck($1.loc, "in");
1447 // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later
1448 $$.qualifier.storage = EvqIn;
1451 parseContext.globalCheck($1.loc, "out");
1453 // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later
1454 $$.qualifier.storage = EvqOut;
1457 parseContext.profileRequires($1.loc, ENoProfile, 120, 0, "centroid");
1458 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "centroid");
1459 parseContext.globalCheck($1.loc, "centroid");
1461 $$.qualifier.centroid = true;
1464 parseContext.globalCheck($1.loc, "uniform");
1466 $$.qualifier.storage = EvqUniform;
1469 parseContext.globalCheck($1.loc, "shared");
1470 parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
1471 parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
1472 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshNVMask | EShLangTaskNVMask), "shared");
1474 $$.qualifier.storage = EvqShared;
1477 parseContext.globalCheck($1.loc, "buffer");
1479 $$.qualifier.storage = EvqBuffer;
1481 GLSLANG_WEB_EXCLUDE_ON
1483 parseContext.requireStage($1.loc, EShLangVertex, "attribute");
1484 parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
1485 parseContext.checkDeprecated($1.loc, ENoProfile, 130, "attribute");
1486 parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "attribute");
1487 parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "attribute");
1489 parseContext.globalCheck($1.loc, "attribute");
1492 $$.qualifier.storage = EvqVaryingIn;
1495 parseContext.checkDeprecated($1.loc, ENoProfile, 130, "varying");
1496 parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "varying");
1497 parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "varying");
1498 parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "varying");
1500 parseContext.globalCheck($1.loc, "varying");
1503 if (parseContext.language == EShLangVertex)
1504 $$.qualifier.storage = EvqVaryingOut;
1506 $$.qualifier.storage = EvqVaryingIn;
1509 parseContext.globalCheck($1.loc, "patch");
1510 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch");
1512 $$.qualifier.patch = true;
1515 parseContext.globalCheck($1.loc, "sample");
1517 $$.qualifier.sample = true;
1520 parseContext.globalCheck($1.loc, "hitAttributeNV");
1521 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
1522 | EShLangAnyHitMask), "hitAttributeNV");
1523 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV");
1525 $$.qualifier.storage = EvqHitAttr;
1528 parseContext.globalCheck($1.loc, "hitAttributeEXT");
1529 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
1530 | EShLangAnyHitMask), "hitAttributeEXT");
1531 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV");
1533 $$.qualifier.storage = EvqHitAttr;
1536 parseContext.globalCheck($1.loc, "rayPayloadNV");
1537 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
1538 EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV");
1539 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV");
1541 $$.qualifier.storage = EvqPayload;
1544 parseContext.globalCheck($1.loc, "rayPayloadEXT");
1545 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
1546 EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT");
1547 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT");
1549 $$.qualifier.storage = EvqPayload;
1552 parseContext.globalCheck($1.loc, "rayPayloadInNV");
1553 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
1554 EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV");
1555 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV");
1557 $$.qualifier.storage = EvqPayloadIn;
1560 parseContext.globalCheck($1.loc, "rayPayloadInEXT");
1561 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
1562 EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT");
1563 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT");
1565 $$.qualifier.storage = EvqPayloadIn;
1568 parseContext.globalCheck($1.loc, "callableDataNV");
1569 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
1570 EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV");
1571 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV");
1573 $$.qualifier.storage = EvqCallableData;
1576 parseContext.globalCheck($1.loc, "callableDataEXT");
1577 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
1578 EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT");
1579 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT");
1581 $$.qualifier.storage = EvqCallableData;
1584 parseContext.globalCheck($1.loc, "callableDataInNV");
1585 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV");
1586 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV");
1588 $$.qualifier.storage = EvqCallableDataIn;
1591 parseContext.globalCheck($1.loc, "callableDataInEXT");
1592 parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT");
1593 parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT");
1595 $$.qualifier.storage = EvqCallableDataIn;
1599 $$.qualifier.coherent = true;
1603 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent");
1604 $$.qualifier.devicecoherent = true;
1606 | QUEUEFAMILYCOHERENT {
1608 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent");
1609 $$.qualifier.queuefamilycoherent = true;
1611 | WORKGROUPCOHERENT {
1613 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent");
1614 $$.qualifier.workgroupcoherent = true;
1616 | SUBGROUPCOHERENT {
1618 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent");
1619 $$.qualifier.subgroupcoherent = true;
1623 parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate");
1624 $$.qualifier.nonprivate = true;
1626 | SHADERCALLCOHERENT {
1628 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent");
1629 $$.qualifier.shadercallcoherent = true;
1633 $$.qualifier.volatil = true;
1637 $$.qualifier.restrict = true;
1641 $$.qualifier.readonly = true;
1645 $$.qualifier.writeonly = true;
1648 parseContext.spvRemoved($1.loc, "subroutine");
1649 parseContext.globalCheck($1.loc, "subroutine");
1650 parseContext.unimplemented($1.loc, "subroutine");
1653 | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN {
1654 parseContext.spvRemoved($1.loc, "subroutine");
1655 parseContext.globalCheck($1.loc, "subroutine");
1656 parseContext.unimplemented($1.loc, "subroutine");
1659 GLSLANG_WEB_EXCLUDE_OFF
1662 GLSLANG_WEB_EXCLUDE_ON
1663 non_uniform_qualifier
1666 $$.qualifier.nonUniform = true;
1674 | type_name_list COMMA IDENTIFIER {
1675 // TODO: 4.0 semantics: subroutines
1676 // 1) make sure each identifier is a type declared earlier with SUBROUTINE
1677 // 2) save all of the identifiers for future comparison with the declared function
1680 GLSLANG_WEB_EXCLUDE_OFF
1683 : type_specifier_nonarray type_parameter_specifier_opt {
1685 $$.qualifier.precision = parseContext.getDefaultPrecision($$);
1686 $$.typeParameters = $2;
1688 | type_specifier_nonarray type_parameter_specifier_opt array_specifier {
1689 parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
1691 $$.qualifier.precision = parseContext.getDefaultPrecision($$);
1692 $$.typeParameters = $2;
1693 $$.arraySizes = $3.arraySizes;
1698 : LEFT_BRACKET RIGHT_BRACKET {
1700 $$.arraySizes = new TArraySizes;
1701 $$.arraySizes->addInnerSize();
1703 | LEFT_BRACKET conditional_expression RIGHT_BRACKET {
1705 $$.arraySizes = new TArraySizes;
1708 parseContext.arraySizeCheck($2->getLoc(), $2, size, "array size");
1709 $$.arraySizes->addInnerSize(size);
1711 | array_specifier LEFT_BRACKET RIGHT_BRACKET {
1713 $$.arraySizes->addInnerSize();
1715 | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET {
1719 parseContext.arraySizeCheck($3->getLoc(), $3, size, "array size");
1720 $$.arraySizes->addInnerSize(size);
1724 type_parameter_specifier_opt
1725 : type_parameter_specifier {
1728 | /* May be null */ {
1733 type_parameter_specifier
1734 : LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE {
1739 type_parameter_specifier_list
1740 : unary_expression {
1741 $$ = new TArraySizes;
1744 parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
1745 $$->addInnerSize(size);
1747 | type_parameter_specifier_list COMMA unary_expression {
1751 parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
1752 $$->addInnerSize(size);
1756 type_specifier_nonarray
1758 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1759 $$.basicType = EbtVoid;
1762 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1763 $$.basicType = EbtFloat;
1766 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1767 $$.basicType = EbtInt;
1770 parseContext.fullIntegerCheck($1.loc, "unsigned integer");
1771 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1772 $$.basicType = EbtUint;
1775 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1776 $$.basicType = EbtBool;
1779 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1780 $$.basicType = EbtFloat;
1784 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1785 $$.basicType = EbtFloat;
1789 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1790 $$.basicType = EbtFloat;
1794 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1795 $$.basicType = EbtBool;
1799 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1800 $$.basicType = EbtBool;
1804 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1805 $$.basicType = EbtBool;
1809 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1810 $$.basicType = EbtInt;
1814 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1815 $$.basicType = EbtInt;
1819 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1820 $$.basicType = EbtInt;
1824 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1825 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1826 $$.basicType = EbtUint;
1830 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1831 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1832 $$.basicType = EbtUint;
1836 parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
1837 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1838 $$.basicType = EbtUint;
1842 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1843 $$.basicType = EbtFloat;
1847 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1848 $$.basicType = EbtFloat;
1852 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1853 $$.basicType = EbtFloat;
1857 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1858 $$.basicType = EbtFloat;
1862 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1863 $$.basicType = EbtFloat;
1867 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1868 $$.basicType = EbtFloat;
1872 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1873 $$.basicType = EbtFloat;
1877 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1878 $$.basicType = EbtFloat;
1882 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1883 $$.basicType = EbtFloat;
1887 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1888 $$.basicType = EbtFloat;
1892 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1893 $$.basicType = EbtFloat;
1897 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1898 $$.basicType = EbtFloat;
1901 GLSLANG_WEB_EXCLUDE_ON
1903 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
1904 if (! parseContext.symbolTable.atBuiltInLevel())
1905 parseContext.doubleCheck($1.loc, "double");
1906 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1907 $$.basicType = EbtDouble;
1910 parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel());
1911 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1912 $$.basicType = EbtFloat16;
1915 parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel());
1916 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1917 $$.basicType = EbtFloat;
1920 parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel());
1921 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1922 $$.basicType = EbtDouble;
1925 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1926 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1927 $$.basicType = EbtInt8;
1930 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1931 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1932 $$.basicType = EbtUint8;
1935 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1936 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1937 $$.basicType = EbtInt16;
1940 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1941 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1942 $$.basicType = EbtUint16;
1945 parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
1946 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1947 $$.basicType = EbtInt;
1950 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1951 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1952 $$.basicType = EbtUint;
1955 parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
1956 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1957 $$.basicType = EbtInt64;
1960 parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
1961 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1962 $$.basicType = EbtUint64;
1965 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1966 if (! parseContext.symbolTable.atBuiltInLevel())
1967 parseContext.doubleCheck($1.loc, "double vector");
1968 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1969 $$.basicType = EbtDouble;
1973 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1974 if (! parseContext.symbolTable.atBuiltInLevel())
1975 parseContext.doubleCheck($1.loc, "double vector");
1976 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1977 $$.basicType = EbtDouble;
1981 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
1982 if (! parseContext.symbolTable.atBuiltInLevel())
1983 parseContext.doubleCheck($1.loc, "double vector");
1984 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1985 $$.basicType = EbtDouble;
1989 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
1990 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1991 $$.basicType = EbtFloat16;
1995 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
1996 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
1997 $$.basicType = EbtFloat16;
2001 parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
2002 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2003 $$.basicType = EbtFloat16;
2007 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2008 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2009 $$.basicType = EbtFloat;
2013 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2014 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2015 $$.basicType = EbtFloat;
2019 parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
2020 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2021 $$.basicType = EbtFloat;
2025 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2026 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2027 $$.basicType = EbtDouble;
2031 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2032 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2033 $$.basicType = EbtDouble;
2037 parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
2038 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2039 $$.basicType = EbtDouble;
2043 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2044 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2045 $$.basicType = EbtInt8;
2049 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2050 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2051 $$.basicType = EbtInt8;
2055 parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2056 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2057 $$.basicType = EbtInt8;
2061 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2062 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2063 $$.basicType = EbtInt16;
2067 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2068 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2069 $$.basicType = EbtInt16;
2073 parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2074 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2075 $$.basicType = EbtInt16;
2079 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2080 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2081 $$.basicType = EbtInt;
2085 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2086 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2087 $$.basicType = EbtInt;
2091 parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
2092 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2093 $$.basicType = EbtInt;
2097 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2098 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2099 $$.basicType = EbtInt64;
2103 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2104 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2105 $$.basicType = EbtInt64;
2109 parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
2110 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2111 $$.basicType = EbtInt64;
2115 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2116 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2117 $$.basicType = EbtUint8;
2121 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2122 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2123 $$.basicType = EbtUint8;
2127 parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2128 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2129 $$.basicType = EbtUint8;
2133 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2134 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2135 $$.basicType = EbtUint16;
2139 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2140 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2141 $$.basicType = EbtUint16;
2145 parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2146 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2147 $$.basicType = EbtUint16;
2151 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2152 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2153 $$.basicType = EbtUint;
2157 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2158 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2159 $$.basicType = EbtUint;
2163 parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2164 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2165 $$.basicType = EbtUint;
2169 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2170 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2171 $$.basicType = EbtUint64;
2175 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2176 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2177 $$.basicType = EbtUint64;
2181 parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
2182 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2183 $$.basicType = EbtUint64;
2187 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2188 if (! parseContext.symbolTable.atBuiltInLevel())
2189 parseContext.doubleCheck($1.loc, "double matrix");
2190 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2191 $$.basicType = EbtDouble;
2195 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2196 if (! parseContext.symbolTable.atBuiltInLevel())
2197 parseContext.doubleCheck($1.loc, "double matrix");
2198 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2199 $$.basicType = EbtDouble;
2203 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2204 if (! parseContext.symbolTable.atBuiltInLevel())
2205 parseContext.doubleCheck($1.loc, "double matrix");
2206 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2207 $$.basicType = EbtDouble;
2211 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2212 if (! parseContext.symbolTable.atBuiltInLevel())
2213 parseContext.doubleCheck($1.loc, "double matrix");
2214 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2215 $$.basicType = EbtDouble;
2219 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2220 if (! parseContext.symbolTable.atBuiltInLevel())
2221 parseContext.doubleCheck($1.loc, "double matrix");
2222 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2223 $$.basicType = EbtDouble;
2227 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2228 if (! parseContext.symbolTable.atBuiltInLevel())
2229 parseContext.doubleCheck($1.loc, "double matrix");
2230 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2231 $$.basicType = EbtDouble;
2235 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2236 if (! parseContext.symbolTable.atBuiltInLevel())
2237 parseContext.doubleCheck($1.loc, "double matrix");
2238 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2239 $$.basicType = EbtDouble;
2243 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2244 if (! parseContext.symbolTable.atBuiltInLevel())
2245 parseContext.doubleCheck($1.loc, "double matrix");
2246 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2247 $$.basicType = EbtDouble;
2251 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2252 if (! parseContext.symbolTable.atBuiltInLevel())
2253 parseContext.doubleCheck($1.loc, "double matrix");
2254 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2255 $$.basicType = EbtDouble;
2259 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2260 if (! parseContext.symbolTable.atBuiltInLevel())
2261 parseContext.doubleCheck($1.loc, "double matrix");
2262 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2263 $$.basicType = EbtDouble;
2267 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2268 if (! parseContext.symbolTable.atBuiltInLevel())
2269 parseContext.doubleCheck($1.loc, "double matrix");
2270 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2271 $$.basicType = EbtDouble;
2275 parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
2276 if (! parseContext.symbolTable.atBuiltInLevel())
2277 parseContext.doubleCheck($1.loc, "double matrix");
2278 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2279 $$.basicType = EbtDouble;
2283 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2284 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2285 $$.basicType = EbtFloat16;
2289 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2290 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2291 $$.basicType = EbtFloat16;
2295 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2296 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2297 $$.basicType = EbtFloat16;
2301 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2302 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2303 $$.basicType = EbtFloat16;
2307 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2308 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2309 $$.basicType = EbtFloat16;
2313 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2314 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2315 $$.basicType = EbtFloat16;
2319 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2320 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2321 $$.basicType = EbtFloat16;
2325 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2326 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2327 $$.basicType = EbtFloat16;
2331 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2332 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2333 $$.basicType = EbtFloat16;
2337 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2338 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2339 $$.basicType = EbtFloat16;
2343 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2344 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2345 $$.basicType = EbtFloat16;
2349 parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
2350 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2351 $$.basicType = EbtFloat16;
2355 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2356 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2357 $$.basicType = EbtFloat;
2361 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2362 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2363 $$.basicType = EbtFloat;
2367 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2368 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2369 $$.basicType = EbtFloat;
2373 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2374 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2375 $$.basicType = EbtFloat;
2379 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2380 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2381 $$.basicType = EbtFloat;
2385 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2386 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2387 $$.basicType = EbtFloat;
2391 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2392 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2393 $$.basicType = EbtFloat;
2397 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2398 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2399 $$.basicType = EbtFloat;
2403 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2404 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2405 $$.basicType = EbtFloat;
2409 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2410 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2411 $$.basicType = EbtFloat;
2415 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2416 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2417 $$.basicType = EbtFloat;
2421 parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
2422 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2423 $$.basicType = EbtFloat;
2427 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2428 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2429 $$.basicType = EbtDouble;
2433 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2434 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2435 $$.basicType = EbtDouble;
2439 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2440 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2441 $$.basicType = EbtDouble;
2445 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2446 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2447 $$.basicType = EbtDouble;
2451 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2452 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2453 $$.basicType = EbtDouble;
2457 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2458 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2459 $$.basicType = EbtDouble;
2463 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2464 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2465 $$.basicType = EbtDouble;
2469 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2470 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2471 $$.basicType = EbtDouble;
2475 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2476 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2477 $$.basicType = EbtDouble;
2481 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2482 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2483 $$.basicType = EbtDouble;
2487 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2488 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2489 $$.basicType = EbtDouble;
2493 parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
2494 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2495 $$.basicType = EbtDouble;
2499 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2500 $$.basicType = EbtAccStruct;
2503 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2504 $$.basicType = EbtAccStruct;
2507 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2508 $$.basicType = EbtRayQuery;
2511 parseContext.vulkanRemoved($1.loc, "atomic counter types");
2512 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2513 $$.basicType = EbtAtomicUint;
2516 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2517 $$.basicType = EbtSampler;
2518 $$.sampler.set(EbtFloat, Esd1D);
2520 GLSLANG_WEB_EXCLUDE_OFF
2522 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2523 $$.basicType = EbtSampler;
2524 $$.sampler.set(EbtFloat, Esd2D);
2527 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2528 $$.basicType = EbtSampler;
2529 $$.sampler.set(EbtFloat, Esd3D);
2532 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2533 $$.basicType = EbtSampler;
2534 $$.sampler.set(EbtFloat, EsdCube);
2537 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2538 $$.basicType = EbtSampler;
2539 $$.sampler.set(EbtFloat, Esd2D, false, true);
2541 | SAMPLERCUBESHADOW {
2542 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2543 $$.basicType = EbtSampler;
2544 $$.sampler.set(EbtFloat, EsdCube, false, true);
2547 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2548 $$.basicType = EbtSampler;
2549 $$.sampler.set(EbtFloat, Esd2D, true);
2551 | SAMPLER2DARRAYSHADOW {
2552 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2553 $$.basicType = EbtSampler;
2554 $$.sampler.set(EbtFloat, Esd2D, true, true);
2556 GLSLANG_WEB_EXCLUDE_ON
2558 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2559 $$.basicType = EbtSampler;
2560 $$.sampler.set(EbtFloat, Esd1D, false, true);
2563 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2564 $$.basicType = EbtSampler;
2565 $$.sampler.set(EbtFloat, Esd1D, true);
2567 | SAMPLER1DARRAYSHADOW {
2568 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2569 $$.basicType = EbtSampler;
2570 $$.sampler.set(EbtFloat, Esd1D, true, true);
2572 | SAMPLERCUBEARRAY {
2573 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2574 $$.basicType = EbtSampler;
2575 $$.sampler.set(EbtFloat, EsdCube, true);
2577 | SAMPLERCUBEARRAYSHADOW {
2578 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2579 $$.basicType = EbtSampler;
2580 $$.sampler.set(EbtFloat, EsdCube, true, true);
2583 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2584 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2585 $$.basicType = EbtSampler;
2586 $$.sampler.set(EbtFloat16, Esd1D);
2589 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2590 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2591 $$.basicType = EbtSampler;
2592 $$.sampler.set(EbtFloat16, Esd2D);
2595 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2596 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2597 $$.basicType = EbtSampler;
2598 $$.sampler.set(EbtFloat16, Esd3D);
2601 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2602 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2603 $$.basicType = EbtSampler;
2604 $$.sampler.set(EbtFloat16, EsdCube);
2606 | F16SAMPLER1DSHADOW {
2607 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2608 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2609 $$.basicType = EbtSampler;
2610 $$.sampler.set(EbtFloat16, Esd1D, false, true);
2612 | F16SAMPLER2DSHADOW {
2613 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2614 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2615 $$.basicType = EbtSampler;
2616 $$.sampler.set(EbtFloat16, Esd2D, false, true);
2618 | F16SAMPLERCUBESHADOW {
2619 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2620 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2621 $$.basicType = EbtSampler;
2622 $$.sampler.set(EbtFloat16, EsdCube, false, true);
2624 | F16SAMPLER1DARRAY {
2625 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2626 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2627 $$.basicType = EbtSampler;
2628 $$.sampler.set(EbtFloat16, Esd1D, true);
2630 | F16SAMPLER2DARRAY {
2631 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2632 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2633 $$.basicType = EbtSampler;
2634 $$.sampler.set(EbtFloat16, Esd2D, true);
2636 | F16SAMPLER1DARRAYSHADOW {
2637 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2638 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2639 $$.basicType = EbtSampler;
2640 $$.sampler.set(EbtFloat16, Esd1D, true, true);
2642 | F16SAMPLER2DARRAYSHADOW {
2643 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2644 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2645 $$.basicType = EbtSampler;
2646 $$.sampler.set(EbtFloat16, Esd2D, true, true);
2648 | F16SAMPLERCUBEARRAY {
2649 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2650 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2651 $$.basicType = EbtSampler;
2652 $$.sampler.set(EbtFloat16, EsdCube, true);
2654 | F16SAMPLERCUBEARRAYSHADOW {
2655 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2656 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2657 $$.basicType = EbtSampler;
2658 $$.sampler.set(EbtFloat16, EsdCube, true, true);
2661 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2662 $$.basicType = EbtSampler;
2663 $$.sampler.set(EbtInt, Esd1D);
2665 GLSLANG_WEB_EXCLUDE_OFF
2667 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2668 $$.basicType = EbtSampler;
2669 $$.sampler.set(EbtInt, Esd2D);
2672 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2673 $$.basicType = EbtSampler;
2674 $$.sampler.set(EbtInt, Esd3D);
2677 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2678 $$.basicType = EbtSampler;
2679 $$.sampler.set(EbtInt, EsdCube);
2682 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2683 $$.basicType = EbtSampler;
2684 $$.sampler.set(EbtInt, Esd2D, true);
2687 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2688 $$.basicType = EbtSampler;
2689 $$.sampler.set(EbtUint, Esd2D);
2692 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2693 $$.basicType = EbtSampler;
2694 $$.sampler.set(EbtUint, Esd3D);
2697 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2698 $$.basicType = EbtSampler;
2699 $$.sampler.set(EbtUint, EsdCube);
2701 GLSLANG_WEB_EXCLUDE_ON
2703 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2704 $$.basicType = EbtSampler;
2705 $$.sampler.set(EbtInt, Esd1D, true);
2707 | ISAMPLERCUBEARRAY {
2708 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2709 $$.basicType = EbtSampler;
2710 $$.sampler.set(EbtInt, EsdCube, true);
2713 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2714 $$.basicType = EbtSampler;
2715 $$.sampler.set(EbtUint, Esd1D);
2718 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2719 $$.basicType = EbtSampler;
2720 $$.sampler.set(EbtUint, Esd1D, true);
2722 | USAMPLERCUBEARRAY {
2723 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2724 $$.basicType = EbtSampler;
2725 $$.sampler.set(EbtUint, EsdCube, true);
2727 | TEXTURECUBEARRAY {
2728 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2729 $$.basicType = EbtSampler;
2730 $$.sampler.setTexture(EbtFloat, EsdCube, true);
2732 | ITEXTURECUBEARRAY {
2733 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2734 $$.basicType = EbtSampler;
2735 $$.sampler.setTexture(EbtInt, EsdCube, true);
2737 | UTEXTURECUBEARRAY {
2738 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2739 $$.basicType = EbtSampler;
2740 $$.sampler.setTexture(EbtUint, EsdCube, true);
2742 GLSLANG_WEB_EXCLUDE_OFF
2744 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2745 $$.basicType = EbtSampler;
2746 $$.sampler.set(EbtUint, Esd2D, true);
2749 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2750 $$.basicType = EbtSampler;
2751 $$.sampler.setTexture(EbtFloat, Esd2D);
2754 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2755 $$.basicType = EbtSampler;
2756 $$.sampler.setTexture(EbtFloat, Esd3D);
2759 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2760 $$.basicType = EbtSampler;
2761 $$.sampler.setTexture(EbtFloat, Esd2D, true);
2764 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2765 $$.basicType = EbtSampler;
2766 $$.sampler.setTexture(EbtFloat, EsdCube);
2769 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2770 $$.basicType = EbtSampler;
2771 $$.sampler.setTexture(EbtInt, Esd2D);
2774 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2775 $$.basicType = EbtSampler;
2776 $$.sampler.setTexture(EbtInt, Esd3D);
2779 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2780 $$.basicType = EbtSampler;
2781 $$.sampler.setTexture(EbtInt, EsdCube);
2784 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2785 $$.basicType = EbtSampler;
2786 $$.sampler.setTexture(EbtInt, Esd2D, true);
2789 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2790 $$.basicType = EbtSampler;
2791 $$.sampler.setTexture(EbtUint, Esd2D);
2794 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2795 $$.basicType = EbtSampler;
2796 $$.sampler.setTexture(EbtUint, Esd3D);
2799 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2800 $$.basicType = EbtSampler;
2801 $$.sampler.setTexture(EbtUint, EsdCube);
2804 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2805 $$.basicType = EbtSampler;
2806 $$.sampler.setTexture(EbtUint, Esd2D, true);
2809 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2810 $$.basicType = EbtSampler;
2811 $$.sampler.setPureSampler(false);
2814 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2815 $$.basicType = EbtSampler;
2816 $$.sampler.setPureSampler(true);
2818 GLSLANG_WEB_EXCLUDE_ON
2820 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2821 $$.basicType = EbtSampler;
2822 $$.sampler.set(EbtFloat, EsdRect);
2824 | SAMPLER2DRECTSHADOW {
2825 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2826 $$.basicType = EbtSampler;
2827 $$.sampler.set(EbtFloat, EsdRect, false, true);
2829 | F16SAMPLER2DRECT {
2830 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2831 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2832 $$.basicType = EbtSampler;
2833 $$.sampler.set(EbtFloat16, EsdRect);
2835 | F16SAMPLER2DRECTSHADOW {
2836 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2837 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2838 $$.basicType = EbtSampler;
2839 $$.sampler.set(EbtFloat16, EsdRect, false, true);
2842 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2843 $$.basicType = EbtSampler;
2844 $$.sampler.set(EbtInt, EsdRect);
2847 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2848 $$.basicType = EbtSampler;
2849 $$.sampler.set(EbtUint, EsdRect);
2852 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2853 $$.basicType = EbtSampler;
2854 $$.sampler.set(EbtFloat, EsdBuffer);
2856 | F16SAMPLERBUFFER {
2857 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2858 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2859 $$.basicType = EbtSampler;
2860 $$.sampler.set(EbtFloat16, EsdBuffer);
2863 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2864 $$.basicType = EbtSampler;
2865 $$.sampler.set(EbtInt, EsdBuffer);
2868 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2869 $$.basicType = EbtSampler;
2870 $$.sampler.set(EbtUint, EsdBuffer);
2873 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2874 $$.basicType = EbtSampler;
2875 $$.sampler.set(EbtFloat, Esd2D, false, false, true);
2878 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2879 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2880 $$.basicType = EbtSampler;
2881 $$.sampler.set(EbtFloat16, Esd2D, false, false, true);
2884 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2885 $$.basicType = EbtSampler;
2886 $$.sampler.set(EbtInt, Esd2D, false, false, true);
2889 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2890 $$.basicType = EbtSampler;
2891 $$.sampler.set(EbtUint, Esd2D, false, false, true);
2893 | SAMPLER2DMSARRAY {
2894 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2895 $$.basicType = EbtSampler;
2896 $$.sampler.set(EbtFloat, Esd2D, true, false, true);
2898 | F16SAMPLER2DMSARRAY {
2899 parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
2900 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2901 $$.basicType = EbtSampler;
2902 $$.sampler.set(EbtFloat16, Esd2D, true, false, true);
2904 | ISAMPLER2DMSARRAY {
2905 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2906 $$.basicType = EbtSampler;
2907 $$.sampler.set(EbtInt, Esd2D, true, false, true);
2909 | USAMPLER2DMSARRAY {
2910 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2911 $$.basicType = EbtSampler;
2912 $$.sampler.set(EbtUint, Esd2D, true, false, true);
2915 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2916 $$.basicType = EbtSampler;
2917 $$.sampler.setTexture(EbtFloat, Esd1D);
2920 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2921 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2922 $$.basicType = EbtSampler;
2923 $$.sampler.setTexture(EbtFloat16, Esd1D);
2926 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2927 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2928 $$.basicType = EbtSampler;
2929 $$.sampler.setTexture(EbtFloat16, Esd2D);
2932 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2933 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2934 $$.basicType = EbtSampler;
2935 $$.sampler.setTexture(EbtFloat16, Esd3D);
2938 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2939 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2940 $$.basicType = EbtSampler;
2941 $$.sampler.setTexture(EbtFloat16, EsdCube);
2944 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2945 $$.basicType = EbtSampler;
2946 $$.sampler.setTexture(EbtFloat, Esd1D, true);
2948 | F16TEXTURE1DARRAY {
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, Esd1D, true);
2954 | F16TEXTURE2DARRAY {
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, Esd2D, true);
2960 | F16TEXTURECUBEARRAY {
2961 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2962 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2963 $$.basicType = EbtSampler;
2964 $$.sampler.setTexture(EbtFloat16, EsdCube, true);
2967 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2968 $$.basicType = EbtSampler;
2969 $$.sampler.setTexture(EbtInt, Esd1D);
2972 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2973 $$.basicType = EbtSampler;
2974 $$.sampler.setTexture(EbtInt, Esd1D, true);
2977 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2978 $$.basicType = EbtSampler;
2979 $$.sampler.setTexture(EbtUint, Esd1D);
2982 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2983 $$.basicType = EbtSampler;
2984 $$.sampler.setTexture(EbtUint, Esd1D, true);
2987 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2988 $$.basicType = EbtSampler;
2989 $$.sampler.setTexture(EbtFloat, EsdRect);
2991 | F16TEXTURE2DRECT {
2992 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
2993 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2994 $$.basicType = EbtSampler;
2995 $$.sampler.setTexture(EbtFloat16, EsdRect);
2998 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
2999 $$.basicType = EbtSampler;
3000 $$.sampler.setTexture(EbtInt, EsdRect);
3003 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3004 $$.basicType = EbtSampler;
3005 $$.sampler.setTexture(EbtUint, EsdRect);
3008 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3009 $$.basicType = EbtSampler;
3010 $$.sampler.setTexture(EbtFloat, EsdBuffer);
3012 | F16TEXTUREBUFFER {
3013 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3014 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3015 $$.basicType = EbtSampler;
3016 $$.sampler.setTexture(EbtFloat16, EsdBuffer);
3019 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3020 $$.basicType = EbtSampler;
3021 $$.sampler.setTexture(EbtInt, EsdBuffer);
3024 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3025 $$.basicType = EbtSampler;
3026 $$.sampler.setTexture(EbtUint, EsdBuffer);
3029 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3030 $$.basicType = EbtSampler;
3031 $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true);
3034 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3035 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3036 $$.basicType = EbtSampler;
3037 $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true);
3040 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3041 $$.basicType = EbtSampler;
3042 $$.sampler.setTexture(EbtInt, Esd2D, false, false, true);
3045 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3046 $$.basicType = EbtSampler;
3047 $$.sampler.setTexture(EbtUint, Esd2D, false, false, true);
3049 | TEXTURE2DMSARRAY {
3050 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3051 $$.basicType = EbtSampler;
3052 $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true);
3054 | F16TEXTURE2DMSARRAY {
3055 parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
3056 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3057 $$.basicType = EbtSampler;
3058 $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true);
3060 | ITEXTURE2DMSARRAY {
3061 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3062 $$.basicType = EbtSampler;
3063 $$.sampler.setTexture(EbtInt, Esd2D, true, false, true);
3065 | UTEXTURE2DMSARRAY {
3066 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3067 $$.basicType = EbtSampler;
3068 $$.sampler.setTexture(EbtUint, Esd2D, true, false, true);
3071 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3072 $$.basicType = EbtSampler;
3073 $$.sampler.setImage(EbtFloat, Esd1D);
3076 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3077 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3078 $$.basicType = EbtSampler;
3079 $$.sampler.setImage(EbtFloat16, Esd1D);
3082 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3083 $$.basicType = EbtSampler;
3084 $$.sampler.setImage(EbtInt, Esd1D);
3087 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3088 $$.basicType = EbtSampler;
3089 $$.sampler.setImage(EbtUint, Esd1D);
3092 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3093 $$.basicType = EbtSampler;
3094 $$.sampler.setImage(EbtFloat, Esd2D);
3097 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3098 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3099 $$.basicType = EbtSampler;
3100 $$.sampler.setImage(EbtFloat16, Esd2D);
3103 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3104 $$.basicType = EbtSampler;
3105 $$.sampler.setImage(EbtInt, Esd2D);
3108 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3109 $$.basicType = EbtSampler;
3110 $$.sampler.setImage(EbtUint, Esd2D);
3113 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3114 $$.basicType = EbtSampler;
3115 $$.sampler.setImage(EbtFloat, Esd3D);
3118 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3119 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3120 $$.basicType = EbtSampler;
3121 $$.sampler.setImage(EbtFloat16, Esd3D);
3124 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3125 $$.basicType = EbtSampler;
3126 $$.sampler.setImage(EbtInt, Esd3D);
3129 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3130 $$.basicType = EbtSampler;
3131 $$.sampler.setImage(EbtUint, Esd3D);
3134 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3135 $$.basicType = EbtSampler;
3136 $$.sampler.setImage(EbtFloat, EsdRect);
3139 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3140 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3141 $$.basicType = EbtSampler;
3142 $$.sampler.setImage(EbtFloat16, EsdRect);
3145 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3146 $$.basicType = EbtSampler;
3147 $$.sampler.setImage(EbtInt, EsdRect);
3150 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3151 $$.basicType = EbtSampler;
3152 $$.sampler.setImage(EbtUint, EsdRect);
3155 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3156 $$.basicType = EbtSampler;
3157 $$.sampler.setImage(EbtFloat, EsdCube);
3160 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3161 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3162 $$.basicType = EbtSampler;
3163 $$.sampler.setImage(EbtFloat16, EsdCube);
3166 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3167 $$.basicType = EbtSampler;
3168 $$.sampler.setImage(EbtInt, EsdCube);
3171 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3172 $$.basicType = EbtSampler;
3173 $$.sampler.setImage(EbtUint, EsdCube);
3176 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3177 $$.basicType = EbtSampler;
3178 $$.sampler.setImage(EbtFloat, EsdBuffer);
3181 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3182 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3183 $$.basicType = EbtSampler;
3184 $$.sampler.setImage(EbtFloat16, EsdBuffer);
3187 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3188 $$.basicType = EbtSampler;
3189 $$.sampler.setImage(EbtInt, EsdBuffer);
3192 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3193 $$.basicType = EbtSampler;
3194 $$.sampler.setImage(EbtUint, EsdBuffer);
3197 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3198 $$.basicType = EbtSampler;
3199 $$.sampler.setImage(EbtFloat, Esd1D, true);
3202 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3203 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3204 $$.basicType = EbtSampler;
3205 $$.sampler.setImage(EbtFloat16, Esd1D, true);
3208 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3209 $$.basicType = EbtSampler;
3210 $$.sampler.setImage(EbtInt, Esd1D, true);
3213 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3214 $$.basicType = EbtSampler;
3215 $$.sampler.setImage(EbtUint, Esd1D, true);
3218 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3219 $$.basicType = EbtSampler;
3220 $$.sampler.setImage(EbtFloat, Esd2D, true);
3223 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3224 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3225 $$.basicType = EbtSampler;
3226 $$.sampler.setImage(EbtFloat16, Esd2D, true);
3229 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3230 $$.basicType = EbtSampler;
3231 $$.sampler.setImage(EbtInt, Esd2D, true);
3234 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3235 $$.basicType = EbtSampler;
3236 $$.sampler.setImage(EbtUint, Esd2D, true);
3239 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3240 $$.basicType = EbtSampler;
3241 $$.sampler.setImage(EbtFloat, EsdCube, true);
3243 | F16IMAGECUBEARRAY {
3244 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3245 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3246 $$.basicType = EbtSampler;
3247 $$.sampler.setImage(EbtFloat16, EsdCube, true);
3250 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3251 $$.basicType = EbtSampler;
3252 $$.sampler.setImage(EbtInt, EsdCube, true);
3255 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3256 $$.basicType = EbtSampler;
3257 $$.sampler.setImage(EbtUint, EsdCube, true);
3260 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3261 $$.basicType = EbtSampler;
3262 $$.sampler.setImage(EbtFloat, Esd2D, false, false, true);
3265 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3266 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3267 $$.basicType = EbtSampler;
3268 $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true);
3271 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3272 $$.basicType = EbtSampler;
3273 $$.sampler.setImage(EbtInt, Esd2D, false, false, true);
3276 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3277 $$.basicType = EbtSampler;
3278 $$.sampler.setImage(EbtUint, Esd2D, false, false, true);
3281 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3282 $$.basicType = EbtSampler;
3283 $$.sampler.setImage(EbtFloat, Esd2D, true, false, true);
3285 | F16IMAGE2DMSARRAY {
3286 parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
3287 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3288 $$.basicType = EbtSampler;
3289 $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true);
3292 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3293 $$.basicType = EbtSampler;
3294 $$.sampler.setImage(EbtInt, Esd2D, true, false, true);
3297 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3298 $$.basicType = EbtSampler;
3299 $$.sampler.setImage(EbtUint, Esd2D, true, false, true);
3302 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3303 $$.basicType = EbtSampler;
3304 $$.sampler.setImage(EbtInt64, Esd1D);
3307 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3308 $$.basicType = EbtSampler;
3309 $$.sampler.setImage(EbtUint64, Esd1D);
3312 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3313 $$.basicType = EbtSampler;
3314 $$.sampler.setImage(EbtInt64, Esd2D);
3317 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3318 $$.basicType = EbtSampler;
3319 $$.sampler.setImage(EbtUint64, Esd2D);
3322 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3323 $$.basicType = EbtSampler;
3324 $$.sampler.setImage(EbtInt64, Esd3D);
3327 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3328 $$.basicType = EbtSampler;
3329 $$.sampler.setImage(EbtUint64, Esd3D);
3332 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3333 $$.basicType = EbtSampler;
3334 $$.sampler.setImage(EbtInt64, EsdRect);
3337 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3338 $$.basicType = EbtSampler;
3339 $$.sampler.setImage(EbtUint64, EsdRect);
3342 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3343 $$.basicType = EbtSampler;
3344 $$.sampler.setImage(EbtInt64, EsdCube);
3347 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3348 $$.basicType = EbtSampler;
3349 $$.sampler.setImage(EbtUint64, EsdCube);
3352 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3353 $$.basicType = EbtSampler;
3354 $$.sampler.setImage(EbtInt64, EsdBuffer);
3357 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3358 $$.basicType = EbtSampler;
3359 $$.sampler.setImage(EbtUint64, EsdBuffer);
3362 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3363 $$.basicType = EbtSampler;
3364 $$.sampler.setImage(EbtInt64, Esd1D, true);
3367 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3368 $$.basicType = EbtSampler;
3369 $$.sampler.setImage(EbtUint64, Esd1D, true);
3372 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3373 $$.basicType = EbtSampler;
3374 $$.sampler.setImage(EbtInt64, Esd2D, true);
3377 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3378 $$.basicType = EbtSampler;
3379 $$.sampler.setImage(EbtUint64, Esd2D, true);
3381 | I64IMAGECUBEARRAY {
3382 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3383 $$.basicType = EbtSampler;
3384 $$.sampler.setImage(EbtInt64, EsdCube, true);
3386 | U64IMAGECUBEARRAY {
3387 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3388 $$.basicType = EbtSampler;
3389 $$.sampler.setImage(EbtUint64, EsdCube, true);
3392 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3393 $$.basicType = EbtSampler;
3394 $$.sampler.setImage(EbtInt64, Esd2D, false, false, true);
3397 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3398 $$.basicType = EbtSampler;
3399 $$.sampler.setImage(EbtUint64, Esd2D, false, false, true);
3401 | I64IMAGE2DMSARRAY {
3402 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3403 $$.basicType = EbtSampler;
3404 $$.sampler.setImage(EbtInt64, Esd2D, true, false, true);
3406 | U64IMAGE2DMSARRAY {
3407 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3408 $$.basicType = EbtSampler;
3409 $$.sampler.setImage(EbtUint64, Esd2D, true, false, true);
3411 | SAMPLEREXTERNALOES { // GL_OES_EGL_image_external
3412 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3413 $$.basicType = EbtSampler;
3414 $$.sampler.set(EbtFloat, Esd2D);
3415 $$.sampler.external = true;
3417 | SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target
3418 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3419 $$.basicType = EbtSampler;
3420 $$.sampler.set(EbtFloat, Esd2D);
3421 $$.sampler.yuv = true;
3424 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3425 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3426 $$.basicType = EbtSampler;
3427 $$.sampler.setSubpass(EbtFloat);
3430 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3431 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3432 $$.basicType = EbtSampler;
3433 $$.sampler.setSubpass(EbtFloat, true);
3436 parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
3437 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3438 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3439 $$.basicType = EbtSampler;
3440 $$.sampler.setSubpass(EbtFloat16);
3442 | F16SUBPASSINPUTMS {
3443 parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
3444 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3445 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3446 $$.basicType = EbtSampler;
3447 $$.sampler.setSubpass(EbtFloat16, true);
3450 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3451 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3452 $$.basicType = EbtSampler;
3453 $$.sampler.setSubpass(EbtInt);
3456 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3457 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3458 $$.basicType = EbtSampler;
3459 $$.sampler.setSubpass(EbtInt, true);
3462 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3463 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3464 $$.basicType = EbtSampler;
3465 $$.sampler.setSubpass(EbtUint);
3468 parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
3469 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3470 $$.basicType = EbtSampler;
3471 $$.sampler.setSubpass(EbtUint, true);
3474 parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3475 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3476 $$.basicType = EbtFloat;
3480 parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3481 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3482 $$.basicType = EbtInt;
3486 parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
3487 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3488 $$.basicType = EbtUint;
3491 | spirv_type_specifier {
3492 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
3495 GLSLANG_WEB_EXCLUDE_OFF
3496 | struct_specifier {
3498 $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3499 parseContext.structTypeCheck($$.loc, $$);
3503 // This is for user defined type names. The lexical phase looked up the
3506 if (const TVariable* variable = ($1.symbol)->getAsVariable()) {
3507 const TType& structure = variable->getType();
3508 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3509 $$.basicType = EbtStruct;
3510 $$.userDef = &structure;
3512 parseContext.error($1.loc, "expected type name", $1.string->c_str(), "");
3518 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "highp precision qualifier");
3519 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3520 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqHigh);
3522 | MEDIUM_PRECISION {
3523 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "mediump precision qualifier");
3524 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3525 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqMedium);
3528 parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "lowp precision qualifier");
3529 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
3530 parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqLow);
3535 : STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
3536 TType* structure = new TType($5, *$2.string);
3537 parseContext.structArrayCheck($2.loc, *structure);
3538 TVariable* userTypeDef = new TVariable($2.string, *structure, true);
3539 if (! parseContext.symbolTable.insert(*userTypeDef))
3540 parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct");
3542 $$.basicType = EbtStruct;
3543 $$.userDef = structure;
3544 --parseContext.structNestingLevel;
3546 | STRUCT LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
3547 TType* structure = new TType($4, TString(""));
3549 $$.basicType = EbtStruct;
3550 $$.userDef = structure;
3551 --parseContext.structNestingLevel;
3555 struct_declaration_list
3556 : struct_declaration {
3559 | struct_declaration_list struct_declaration {
3561 for (unsigned int i = 0; i < $2->size(); ++i) {
3562 for (unsigned int j = 0; j < $$->size(); ++j) {
3563 if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName())
3564 parseContext.error((*$2)[i].loc, "duplicate member name:", "", (*$2)[i].type->getFieldName().c_str());
3566 $$->push_back((*$2)[i]);
3572 : type_specifier struct_declarator_list SEMICOLON {
3573 if ($1.arraySizes) {
3574 parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
3575 parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
3576 if (parseContext.isEsProfile())
3577 parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
3582 parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
3583 parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
3585 for (unsigned int i = 0; i < $$->size(); ++i) {
3587 type.setFieldName((*$$)[i].type->getFieldName());
3588 type.transferArraySizes((*$$)[i].type->getArraySizes());
3589 type.copyArrayInnerSizes($1.arraySizes);
3590 parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
3591 (*$$)[i].type->shallowCopy(type);
3594 | type_qualifier type_specifier struct_declarator_list SEMICOLON {
3595 if ($2.arraySizes) {
3596 parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
3597 parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
3598 if (parseContext.isEsProfile())
3599 parseContext.arraySizeRequiredCheck($2.loc, *$2.arraySizes);
3604 parseContext.memberQualifierCheck($1);
3605 parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
3606 parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
3607 parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
3609 for (unsigned int i = 0; i < $$->size(); ++i) {
3611 type.setFieldName((*$$)[i].type->getFieldName());
3612 type.transferArraySizes((*$$)[i].type->getArraySizes());
3613 type.copyArrayInnerSizes($2.arraySizes);
3614 parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
3615 (*$$)[i].type->shallowCopy(type);
3620 struct_declarator_list
3621 : struct_declarator {
3625 | struct_declarator_list COMMA struct_declarator {
3632 $$.type = new TType(EbtVoid);
3634 $$.type->setFieldName(*$1.string);
3636 | IDENTIFIER array_specifier {
3637 parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes);
3639 $$.type = new TType(EbtVoid);
3641 $$.type->setFieldName(*$1.string);
3642 $$.type->transferArraySizes($2.arraySizes);
3647 : assignment_expression {
3650 GLSLANG_WEB_EXCLUDE_ON
3651 | LEFT_BRACE initializer_list RIGHT_BRACE {
3652 const char* initFeature = "{ } style initializers";
3653 parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
3654 parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
3657 | LEFT_BRACE initializer_list COMMA RIGHT_BRACE {
3658 const char* initFeature = "{ } style initializers";
3659 parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
3660 parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
3663 | LEFT_BRACE RIGHT_BRACE {
3664 const char* initFeature = "empty { } initializer";
3665 parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
3666 parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
3667 $$ = parseContext.intermediate.makeAggregate($1.loc);
3669 GLSLANG_WEB_EXCLUDE_OFF
3672 GLSLANG_WEB_EXCLUDE_ON
3675 $$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
3677 | initializer_list COMMA initializer {
3678 $$ = parseContext.intermediate.growAggregate($1, $3);
3681 GLSLANG_WEB_EXCLUDE_OFF
3683 declaration_statement
3684 : declaration { $$ = $1; }
3688 : compound_statement { $$ = $1; }
3689 | simple_statement { $$ = $1; }
3692 // Grammar Note: labeled statements for switch statements only; 'goto' is not supported.
3695 : declaration_statement { $$ = $1; }
3696 | expression_statement { $$ = $1; }
3697 | selection_statement { $$ = $1; }
3698 | switch_statement { $$ = $1; }
3699 | case_label { $$ = $1; }
3700 | iteration_statement { $$ = $1; }
3701 | jump_statement { $$ = $1; }
3702 GLSLANG_WEB_EXCLUDE_ON
3703 | demote_statement { $$ = $1; }
3704 GLSLANG_WEB_EXCLUDE_OFF
3707 GLSLANG_WEB_EXCLUDE_ON
3709 : DEMOTE SEMICOLON {
3710 parseContext.requireStage($1.loc, EShLangFragment, "demote");
3711 parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote");
3712 $$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc);
3715 GLSLANG_WEB_EXCLUDE_OFF
3718 : LEFT_BRACE RIGHT_BRACE { $$ = 0; }
3720 parseContext.symbolTable.push();
3721 ++parseContext.statementNestingLevel;
3724 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3725 --parseContext.statementNestingLevel;
3728 if ($3 && $3->getAsAggregate())
3729 $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
3734 statement_no_new_scope
3735 : compound_statement_no_new_scope { $$ = $1; }
3736 | simple_statement { $$ = $1; }
3741 ++parseContext.controlFlowNestingLevel;
3743 compound_statement {
3744 --parseContext.controlFlowNestingLevel;
3748 parseContext.symbolTable.push();
3749 ++parseContext.statementNestingLevel;
3750 ++parseContext.controlFlowNestingLevel;
3753 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3754 --parseContext.statementNestingLevel;
3755 --parseContext.controlFlowNestingLevel;
3759 compound_statement_no_new_scope
3760 // Statement that doesn't create a new scope, for selection_statement, iteration_statement
3761 : LEFT_BRACE RIGHT_BRACE {
3764 | LEFT_BRACE statement_list RIGHT_BRACE {
3765 if ($2 && $2->getAsAggregate())
3766 $2->getAsAggregate()->setOperator(EOpSequence);
3773 $$ = parseContext.intermediate.makeAggregate($1);
3774 if ($1 && $1->getAsBranchNode() && ($1->getAsBranchNode()->getFlowOp() == EOpCase ||
3775 $1->getAsBranchNode()->getFlowOp() == EOpDefault)) {
3776 parseContext.wrapupSwitchSubsequence(0, $1);
3777 $$ = 0; // start a fresh subsequence for what's after this case
3780 | statement_list statement {
3781 if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase ||
3782 $2->getAsBranchNode()->getFlowOp() == EOpDefault)) {
3783 parseContext.wrapupSwitchSubsequence($1 ? $1->getAsAggregate() : 0, $2);
3784 $$ = 0; // start a fresh subsequence for what's after this case
3786 $$ = parseContext.intermediate.growAggregate($1, $2);
3790 expression_statement
3791 : SEMICOLON { $$ = 0; }
3792 | expression SEMICOLON { $$ = static_cast<TIntermNode*>($1); }
3796 : selection_statement_nonattributed {
3799 GLSLANG_WEB_EXCLUDE_ON
3800 | attribute selection_statement_nonattributed {
3801 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3802 parseContext.handleSelectionAttributes(*$1, $2);
3805 GLSLANG_WEB_EXCLUDE_OFF
3807 selection_statement_nonattributed
3808 : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
3809 parseContext.boolCheck($1.loc, $3);
3810 $$ = parseContext.intermediate.addSelection($3, $5, $1.loc);
3814 selection_rest_statement
3815 : statement_scoped ELSE statement_scoped {
3819 | statement_scoped {
3826 // In 1996 c++ draft, conditions can include single declarations
3829 parseContext.boolCheck($1->getLoc(), $1);
3831 | fully_specified_type IDENTIFIER EQUAL initializer {
3832 parseContext.boolCheck($2.loc, $1);
3835 TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
3837 $$ = initNode->getAsTyped();
3844 : switch_statement_nonattributed {
3847 GLSLANG_WEB_EXCLUDE_ON
3848 | attribute switch_statement_nonattributed {
3849 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3850 parseContext.handleSwitchAttributes(*$1, $2);
3853 GLSLANG_WEB_EXCLUDE_OFF
3855 switch_statement_nonattributed
3856 : SWITCH LEFT_PAREN expression RIGHT_PAREN {
3857 // start new switch sequence on the switch stack
3858 ++parseContext.controlFlowNestingLevel;
3859 ++parseContext.statementNestingLevel;
3860 parseContext.switchSequenceStack.push_back(new TIntermSequence);
3861 parseContext.switchLevel.push_back(parseContext.statementNestingLevel);
3862 parseContext.symbolTable.push();
3864 LEFT_BRACE switch_statement_list RIGHT_BRACE {
3865 $$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0);
3866 delete parseContext.switchSequenceStack.back();
3867 parseContext.switchSequenceStack.pop_back();
3868 parseContext.switchLevel.pop_back();
3869 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3870 --parseContext.statementNestingLevel;
3871 --parseContext.controlFlowNestingLevel;
3875 switch_statement_list
3885 : CASE expression COLON {
3887 if (parseContext.switchLevel.size() == 0)
3888 parseContext.error($1.loc, "cannot appear outside switch statement", "case", "");
3889 else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
3890 parseContext.error($1.loc, "cannot be nested inside control flow", "case", "");
3892 parseContext.constantValueCheck($2, "case");
3893 parseContext.integerCheck($2, "case");
3894 $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc);
3899 if (parseContext.switchLevel.size() == 0)
3900 parseContext.error($1.loc, "cannot appear outside switch statement", "default", "");
3901 else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
3902 parseContext.error($1.loc, "cannot be nested inside control flow", "default", "");
3904 $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc);
3909 : iteration_statement_nonattributed {
3912 GLSLANG_WEB_EXCLUDE_ON
3913 | attribute iteration_statement_nonattributed {
3914 parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
3915 parseContext.handleLoopAttributes(*$1, $2);
3918 GLSLANG_WEB_EXCLUDE_OFF
3920 iteration_statement_nonattributed
3921 : WHILE LEFT_PAREN {
3922 if (! parseContext.limits.whileLoops)
3923 parseContext.error($1.loc, "while loops not available", "limitation", "");
3924 parseContext.symbolTable.push();
3925 ++parseContext.loopNestingLevel;
3926 ++parseContext.statementNestingLevel;
3927 ++parseContext.controlFlowNestingLevel;
3929 condition RIGHT_PAREN statement_no_new_scope {
3930 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3931 $$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.loc);
3932 --parseContext.loopNestingLevel;
3933 --parseContext.statementNestingLevel;
3934 --parseContext.controlFlowNestingLevel;
3937 parseContext.symbolTable.push();
3938 ++parseContext.loopNestingLevel;
3939 ++parseContext.statementNestingLevel;
3940 ++parseContext.controlFlowNestingLevel;
3942 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON {
3943 if (! parseContext.limits.whileLoops)
3944 parseContext.error($1.loc, "do-while loops not available", "limitation", "");
3946 parseContext.boolCheck($8.loc, $6);
3948 $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc);
3949 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3950 --parseContext.loopNestingLevel;
3951 --parseContext.statementNestingLevel;
3952 --parseContext.controlFlowNestingLevel;
3955 parseContext.symbolTable.push();
3956 ++parseContext.loopNestingLevel;
3957 ++parseContext.statementNestingLevel;
3958 ++parseContext.controlFlowNestingLevel;
3960 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope {
3961 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
3962 $$ = parseContext.intermediate.makeAggregate($4, $2.loc);
3963 TIntermLoop* forLoop = parseContext.intermediate.addLoop($7, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), true, $1.loc);
3964 if (! parseContext.limits.nonInductiveForLoops)
3965 parseContext.inductiveLoopCheck($1.loc, $4, forLoop);
3966 $$ = parseContext.intermediate.growAggregate($$, forLoop, $1.loc);
3967 $$->getAsAggregate()->setOperator(EOpSequence);
3968 --parseContext.loopNestingLevel;
3969 --parseContext.statementNestingLevel;
3970 --parseContext.controlFlowNestingLevel;
3975 : expression_statement {
3978 | declaration_statement {
3987 | /* May be null */ {
3993 : conditionopt SEMICOLON {
3997 | conditionopt SEMICOLON expression {
4004 : CONTINUE SEMICOLON {
4005 if (parseContext.loopNestingLevel <= 0)
4006 parseContext.error($1.loc, "continue statement only allowed in loops", "", "");
4007 $$ = parseContext.intermediate.addBranch(EOpContinue, $1.loc);
4010 if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0)
4011 parseContext.error($1.loc, "break statement only allowed in switch and loops", "", "");
4012 $$ = parseContext.intermediate.addBranch(EOpBreak, $1.loc);
4014 | RETURN SEMICOLON {
4015 $$ = parseContext.intermediate.addBranch(EOpReturn, $1.loc);
4016 if (parseContext.currentFunctionType->getBasicType() != EbtVoid)
4017 parseContext.error($1.loc, "non-void function must return a value", "return", "");
4018 if (parseContext.inMain)
4019 parseContext.postEntryPointReturn = true;
4021 | RETURN expression SEMICOLON {
4022 $$ = parseContext.handleReturnValue($1.loc, $2);
4024 | DISCARD SEMICOLON {
4025 parseContext.requireStage($1.loc, EShLangFragment, "discard");
4026 $$ = parseContext.intermediate.addBranch(EOpKill, $1.loc);
4028 | TERMINATE_INVOCATION SEMICOLON {
4029 parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
4030 $$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
4032 GLSLANG_WEB_EXCLUDE_ON
4033 | TERMINATE_RAY SEMICOLON {
4034 parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
4035 $$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
4037 | IGNORE_INTERSECTION SEMICOLON {
4038 parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
4039 $$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
4041 GLSLANG_WEB_EXCLUDE_OFF
4044 // Grammar Note: No 'goto'. Gotos are not supported.
4047 : external_declaration {
4049 parseContext.intermediate.setTreeRoot($$);
4051 | translation_unit external_declaration {
4052 if ($2 != nullptr) {
4053 $$ = parseContext.intermediate.growAggregate($1, $2);
4054 parseContext.intermediate.setTreeRoot($$);
4059 external_declaration
4060 : function_definition {
4066 GLSLANG_WEB_EXCLUDE_ON
4068 parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
4069 parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
4072 GLSLANG_WEB_EXCLUDE_OFF
4076 : function_prototype {
4077 $1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */);
4078 $1.intermNode = parseContext.handleFunctionDefinition($1.loc, *$1.function);
4080 // For ES 100 only, according to ES shading language 100 spec: A function
4081 // body has a scope nested inside the function's definition.
4082 if (parseContext.profile == EEsProfile && parseContext.version == 100)
4084 parseContext.symbolTable.push();
4085 ++parseContext.statementNestingLevel;
4088 compound_statement_no_new_scope {
4089 // May be best done as post process phase on intermediate code
4090 if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
4091 parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str());
4092 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
4093 $$ = parseContext.intermediate.growAggregate($1.intermNode, $3);
4094 parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc);
4095 $$->getAsAggregate()->setName($1.function->getMangledName().c_str());
4097 // store the pragma information for debug and optimize and other vendor specific
4098 // information. This information can be queried from the parse tree
4099 $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
4100 $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
4101 $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable);
4103 // Set currentFunctionType to empty pointer when goes outside of the function
4104 parseContext.currentFunctionType = nullptr;
4106 // For ES 100 only, according to ES shading language 100 spec: A function
4107 // body has a scope nested inside the function's definition.
4108 if (parseContext.profile == EEsProfile && parseContext.version == 100)
4110 parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
4111 --parseContext.statementNestingLevel;
4116 GLSLANG_WEB_EXCLUDE_ON
4118 : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
4123 : single_attribute {
4126 | attribute_list COMMA single_attribute {
4127 $$ = parseContext.mergeAttributes($1, $3);
4132 $$ = parseContext.makeAttributes(*$1.string);
4134 | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN {
4135 $$ = parseContext.makeAttributes(*$1.string, $3);
4137 GLSLANG_WEB_EXCLUDE_OFF
4139 GLSLANG_WEB_EXCLUDE_ON
4140 spirv_requirements_list
4141 : spirv_requirements_parameter {
4144 | spirv_requirements_list COMMA spirv_requirements_parameter {
4145 $$ = parseContext.mergeSpirvRequirements($2.loc, $1, $3);
4148 spirv_requirements_parameter
4149 : IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET {
4150 $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, $4->getAsAggregate(), nullptr);
4152 | IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET {
4153 $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, nullptr, $4->getAsAggregate());
4156 spirv_extension_list
4158 $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
4160 | spirv_extension_list COMMA STRING_LITERAL {
4161 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
4164 spirv_capability_list
4166 $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.i, $1.loc, true));
4168 | spirv_capability_list COMMA INTCONSTANT {
4169 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.i, $3.loc, true));
4172 spirv_execution_mode_qualifier
4173 : SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN {
4174 parseContext.intermediate.insertSpirvExecutionMode($3.i);
4177 | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
4178 parseContext.intermediate.insertSpirvRequirement($3);
4179 parseContext.intermediate.insertSpirvExecutionMode($5.i);
4182 | SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
4183 parseContext.intermediate.insertSpirvExecutionMode($3.i, $5->getAsAggregate());
4186 | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
4187 parseContext.intermediate.insertSpirvRequirement($3);
4188 parseContext.intermediate.insertSpirvExecutionMode($5.i, $7->getAsAggregate());
4191 | SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
4192 parseContext.intermediate.insertSpirvExecutionModeId($3.i, $5->getAsAggregate());
4195 | SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
4196 parseContext.intermediate.insertSpirvRequirement($3);
4197 parseContext.intermediate.insertSpirvExecutionModeId($5.i, $7->getAsAggregate());
4201 spirv_execution_mode_parameter_list
4202 : spirv_execution_mode_parameter {
4203 $$ = parseContext.intermediate.makeAggregate($1);
4205 | spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter {
4206 $$ = parseContext.intermediate.growAggregate($1, $3);
4209 spirv_execution_mode_parameter
4211 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
4214 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
4217 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
4220 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
4223 $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
4226 spirv_execution_mode_id_parameter_list
4227 : constant_expression {
4228 if ($1->getBasicType() != EbtFloat &&
4229 $1->getBasicType() != EbtInt &&
4230 $1->getBasicType() != EbtUint &&
4231 $1->getBasicType() != EbtBool &&
4232 $1->getBasicType() != EbtString)
4233 parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
4234 $$ = parseContext.intermediate.makeAggregate($1);
4236 | spirv_execution_mode_id_parameter_list COMMA constant_expression {
4237 if ($3->getBasicType() != EbtFloat &&
4238 $3->getBasicType() != EbtInt &&
4239 $3->getBasicType() != EbtUint &&
4240 $3->getBasicType() != EbtBool &&
4241 $3->getBasicType() != EbtString)
4242 parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
4243 $$ = parseContext.intermediate.growAggregate($1, $3);
4246 spirv_storage_class_qualifier
4247 : SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN {
4249 $$.qualifier.storage = EvqSpirvStorageClass;
4250 $$.qualifier.spirvStorageClass = $3.i;
4252 | SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
4254 parseContext.intermediate.insertSpirvRequirement($3);
4255 $$.qualifier.storage = EvqSpirvStorageClass;
4256 $$.qualifier.spirvStorageClass = $5.i;
4259 spirv_decorate_qualifier
4260 : SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN{
4262 $$.qualifier.setSpirvDecorate($3.i);
4264 | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN{
4266 parseContext.intermediate.insertSpirvRequirement($3);
4267 $$.qualifier.setSpirvDecorate($5.i);
4269 | SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
4271 $$.qualifier.setSpirvDecorate($3.i, $5->getAsAggregate());
4273 | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
4275 parseContext.intermediate.insertSpirvRequirement($3);
4276 $$.qualifier.setSpirvDecorate($5.i, $7->getAsAggregate());
4278 | SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
4280 $$.qualifier.setSpirvDecorateId($3.i, $5->getAsAggregate());
4282 | SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
4284 parseContext.intermediate.insertSpirvRequirement($3);
4285 $$.qualifier.setSpirvDecorateId($5.i, $7->getAsAggregate());
4287 | SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
4289 $$.qualifier.setSpirvDecorateString($3.i, $5->getAsAggregate());
4291 | SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
4293 parseContext.intermediate.insertSpirvRequirement($3);
4294 $$.qualifier.setSpirvDecorateString($5.i, $7->getAsAggregate());
4297 spirv_decorate_parameter_list
4298 : spirv_decorate_parameter {
4299 $$ = parseContext.intermediate.makeAggregate($1);
4301 | spirv_decorate_parameter_list COMMA spirv_decorate_parameter {
4302 $$ = parseContext.intermediate.growAggregate($1, $3);
4305 spirv_decorate_parameter
4307 $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
4310 $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
4313 $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
4316 $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
4319 spirv_decorate_id_parameter_list
4320 : constant_expression {
4321 if ($1->getBasicType() != EbtFloat &&
4322 $1->getBasicType() != EbtInt &&
4323 $1->getBasicType() != EbtUint &&
4324 $1->getBasicType() != EbtBool)
4325 parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
4326 $$ = parseContext.intermediate.makeAggregate($1);
4328 | spirv_decorate_id_parameter_list COMMA constant_expression {
4329 if ($3->getBasicType() != EbtFloat &&
4330 $3->getBasicType() != EbtInt &&
4331 $3->getBasicType() != EbtUint &&
4332 $3->getBasicType() != EbtBool)
4333 parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
4334 $$ = parseContext.intermediate.growAggregate($1, $3);
4337 spirv_decorate_string_parameter_list
4339 $$ = parseContext.intermediate.makeAggregate(
4340 parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
4342 | spirv_decorate_string_parameter_list COMMA STRING_LITERAL {
4343 $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
4346 spirv_type_specifier
4347 : SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
4348 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4349 $$.setSpirvType(*$3, $5);
4351 | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
4352 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4353 parseContext.intermediate.insertSpirvRequirement($3);
4354 $$.setSpirvType(*$5, $7);
4356 | SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
4357 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4358 $$.setSpirvType(*$3);
4360 | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
4361 $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
4362 parseContext.intermediate.insertSpirvRequirement($3);
4363 $$.setSpirvType(*$5);
4366 spirv_type_parameter_list
4367 : spirv_type_parameter {
4370 | spirv_type_parameter_list COMMA spirv_type_parameter {
4371 $$ = parseContext.mergeSpirvTypeParameters($1, $3);
4374 spirv_type_parameter
4375 : constant_expression {
4376 $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion());
4379 spirv_instruction_qualifier
4380 : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
4383 | SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
4384 parseContext.intermediate.insertSpirvRequirement($3);
4388 spirv_instruction_qualifier_list
4389 : spirv_instruction_qualifier_id {
4392 | spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id {
4393 $$ = parseContext.mergeSpirvInstruction($2.loc, $1, $3);
4396 spirv_instruction_qualifier_id
4397 : IDENTIFIER EQUAL STRING_LITERAL {
4398 $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, *$3.string);
4400 | IDENTIFIER EQUAL INTCONSTANT {
4401 $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);
4403 GLSLANG_WEB_EXCLUDE_OFF