Customize glslang.y to GLSLANG_ANGLE

glslang.y is specialized to remove what is not supported or won't be
supported by ANGLE.

This change shaves about 125KB off of ANGLE's binary size with minor
improvement to the cost of SetupBuiltinSymbolTable.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
This commit is contained in:
Shahbaz Youssefi 2020-07-03 15:42:53 -04:00
parent 8c49d15fbf
commit 59fb2d6361
No known key found for this signature in database
GPG key ID: C6149357EC6727E0
11 changed files with 13943 additions and 3495 deletions

View file

@ -58,6 +58,12 @@
//
// m4 -P
//
// A similar mechanism is used to exclude grammar for ANGLE with
// GLSLANG_ANGLE_EXCLUDE_ON, GLSLANG_ANGLE_EXCLUDE_OFF and -DGLSLANG_ANGLE
//
@ -177,6 +183,9 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> ATTRIBUTE VARYING
%token <lex> FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
%token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
%token <lex> I64VEC2 I64VEC3 I64VEC4
@ -209,23 +218,31 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> RAYQUERYEXT
%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
// combined image/sampler
%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
%token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
%token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY
%token <lex> SAMPLEREXTERNALOES
%token <lex> SAMPLEREXTERNAL2DY2YEXT
%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
%token <lex> ISAMPLER1DARRAY USAMPLER1D USAMPLER1DARRAY
%token <lex> F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE
%token <lex> F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY
%token <lex> F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY
%token <lex> F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW
%token <lex> F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW
// images
%token <lex> IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D
%token <lex> UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D
@ -238,10 +255,14 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> IMAGE2DMS IIMAGE2DMS UIMAGE2DMS
%token <lex> IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY
%token <lex> F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT
%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
// texture without sampler
%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
@ -251,6 +272,8 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
%token <lex> F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE
%token <lex> F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY
%token <lex> F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY
@ -261,6 +284,8 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> LEFT_OP RIGHT_OP
%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
@ -285,18 +310,28 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> FLAT SMOOTH LAYOUT
%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
%token <lex> INT64CONSTANT UINT64CONSTANT
%token <lex> SUBROUTINE DEMOTE
%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV
%token <lex> PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT
%token <lex> PATCH SAMPLE NONUNIFORM
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
%token <lex> NONUNIFORM
%token <lex> DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
%token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
%token <lex> EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
%token <lex> PATCH SAMPLE
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY
%token <lex> NOPERSPECTIVE
%token <lex> PRECISE
%type <interm> assignment_operator unary_operator
%type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
%type <interm.intermTypedNode> expression integer_expression assignment_expression
@ -343,13 +378,21 @@ extern int yylex(YYSTYPE*, TParseContext&);
%type <interm.identifierList> identifier_list
%type <interm.type> precise_qualifier non_uniform_qualifier
%type <interm.type> non_uniform_qualifier
%type <interm.intermNode> demote_statement
%type <interm.type> precise_qualifier
%type <interm.typeList> type_name_list
%type <interm.attributes> attribute attribute_list single_attribute
%type <interm.intermNode> demote_statement
%type <interm.intermTypedNode> initializer_list
%start translation_unit
%%
@ -382,6 +425,7 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
}
| STRING_LITERAL {
$$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
}
@ -420,6 +464,7 @@ primary_expression
$$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
}
;
postfix_expression
@ -546,12 +591,14 @@ function_identifier
}
}
| non_uniform_qualifier {
// Constructor
$$.intermNode = 0;
$$.function = parseContext.handleConstructorCall($1.loc, $1);
}
;
unary_expression
@ -1207,6 +1254,7 @@ interpolation_qualifier
$$.init($1.loc);
$$.qualifier.nopersp = true;
}
| EXPLICITINTERPAMD {
parseContext.globalCheck($1.loc, "__explicitInterpAMD");
parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
@ -1247,6 +1295,7 @@ interpolation_qualifier
$$.qualifier.perTaskNV = true;
}
;
layout_qualifier
@ -1330,10 +1379,12 @@ single_type_qualifier
// allow inheritance of storage qualifier from block declaration
$$ = $1;
}
| non_uniform_qualifier {
$$ = $1;
}
;
storage_qualifier
@ -1421,6 +1472,7 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.sample = true;
}
| HITATTRNV {
parseContext.globalCheck($1.loc, "hitAttributeNV");
parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
@ -1499,10 +1551,6 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.storage = EvqCallableDataIn;
}
| COHERENT {
$$.init($1.loc);
$$.qualifier.coherent = true;
}
| DEVICECOHERENT {
$$.init($1.loc);
parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent");
@ -1533,6 +1581,23 @@ storage_qualifier
parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent");
$$.qualifier.shadercallcoherent = true;
}
| SUBROUTINE {
parseContext.spvRemoved($1.loc, "subroutine");
parseContext.globalCheck($1.loc, "subroutine");
parseContext.unimplemented($1.loc, "subroutine");
$$.init($1.loc);
}
| SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN {
parseContext.spvRemoved($1.loc, "subroutine");
parseContext.globalCheck($1.loc, "subroutine");
parseContext.unimplemented($1.loc, "subroutine");
$$.init($1.loc);
}
| COHERENT {
$$.init($1.loc);
$$.qualifier.coherent = true;
}
| VOLATILE {
$$.init($1.loc);
$$.qualifier.volatil = true;
@ -1549,22 +1614,11 @@ storage_qualifier
$$.init($1.loc);
$$.qualifier.writeonly = true;
}
| SUBROUTINE {
parseContext.spvRemoved($1.loc, "subroutine");
parseContext.globalCheck($1.loc, "subroutine");
parseContext.unimplemented($1.loc, "subroutine");
$$.init($1.loc);
}
| SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN {
parseContext.spvRemoved($1.loc, "subroutine");
parseContext.globalCheck($1.loc, "subroutine");
parseContext.unimplemented($1.loc, "subroutine");
$$.init($1.loc);
}
;
non_uniform_qualifier
: NONUNIFORM {
$$.init($1.loc);
@ -1572,6 +1626,7 @@ non_uniform_qualifier
}
;
type_name_list
: IDENTIFIER {
// TODO
@ -1804,6 +1859,7 @@ type_specifier_nonarray
$$.setMatrix(4, 4);
}
| DOUBLE {
parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
if (! parseContext.symbolTable.atBuiltInLevel())
@ -2423,6 +2479,7 @@ type_specifier_nonarray
$$.sampler.set(EbtFloat, Esd1D);
}
| SAMPLER2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2459,6 +2516,17 @@ type_specifier_nonarray
$$.sampler.set(EbtFloat, Esd2D, true, true);
}
| SAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, true);
}
| SAMPLERCUBEARRAYSHADOW {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, true, true);
}
| SAMPLER1DSHADOW {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2474,16 +2542,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, Esd1D, true, true);
}
| SAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, true);
}
| SAMPLERCUBEARRAYSHADOW {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdCube, true, true);
}
| F16SAMPLER1D {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -2568,6 +2626,7 @@ type_specifier_nonarray
$$.sampler.set(EbtInt, Esd1D);
}
| ISAMPLER2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2604,26 +2663,11 @@ type_specifier_nonarray
$$.sampler.set(EbtUint, EsdCube);
}
| ISAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, Esd1D, true);
}
| ISAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, EsdCube, true);
}
| USAMPLER1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd1D);
}
| USAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd1D, true);
}
| USAMPLERCUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2645,6 +2689,23 @@ type_specifier_nonarray
$$.sampler.setTexture(EbtUint, EsdCube, true);
}
| ISAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, Esd1D, true);
}
| USAMPLER1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd1D);
}
| USAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd1D, true);
}
| USAMPLER2DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2731,18 +2792,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdRect, false, true);
}
| F16SAMPLER2DRECT {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, EsdRect);
}
| F16SAMPLER2DRECTSHADOW {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, EsdRect, false, true);
}
| ISAMPLER2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2758,12 +2807,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, EsdBuffer);
}
| F16SAMPLERBUFFER {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, EsdBuffer);
}
| ISAMPLERBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2779,12 +2822,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, Esd2D, false, false, true);
}
| F16SAMPLER2DMS {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, Esd2D, false, false, true);
}
| ISAMPLER2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2800,12 +2837,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat, Esd2D, true, false, true);
}
| F16SAMPLER2DMSARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, Esd2D, true, false, true);
}
| ISAMPLER2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2816,11 +2847,129 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.set(EbtUint, Esd2D, true, false, true);
}
| F16SAMPLER2DRECT {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, EsdRect);
}
| F16SAMPLER2DRECTSHADOW {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, EsdRect, false, true);
}
| F16SAMPLERBUFFER {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, EsdBuffer);
}
| F16SAMPLER2DMS {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, Esd2D, false, false, true);
}
| F16SAMPLER2DMSARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtFloat16, Esd2D, true, false, true);
}
| TEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd1D);
}
| TEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd1D, true);
}
| ITEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D);
}
| ITEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D, true);
}
| UTEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D);
}
| UTEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D, true);
}
| TEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, EsdRect);
}
| ITEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, EsdRect);
}
| UTEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, EsdRect);
}
| TEXTUREBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, EsdBuffer);
}
| ITEXTUREBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, EsdBuffer);
}
| UTEXTUREBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, EsdBuffer);
}
| TEXTURE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd2D, false, false, true);
}
| ITEXTURE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd2D, false, false, true);
}
| UTEXTURE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd2D, false, false, true);
}
| TEXTURE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd2D, true, false, true);
}
| ITEXTURE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd2D, true, false, true);
}
| UTEXTURE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd2D, true, false, true);
}
| F16TEXTURE1D {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -2845,11 +2994,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, EsdCube);
}
| TEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd1D, true);
}
| F16TEXTURE1DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -2868,121 +3012,35 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, EsdCube, true);
}
| ITEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D);
}
| ITEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd1D, true);
}
| UTEXTURE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D);
}
| UTEXTURE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd1D, true);
}
| TEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, EsdRect);
}
| F16TEXTURE2DRECT {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, EsdRect);
}
| ITEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, EsdRect);
}
| UTEXTURE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, EsdRect);
}
| TEXTUREBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, EsdBuffer);
}
| F16TEXTUREBUFFER {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, EsdBuffer);
}
| ITEXTUREBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, EsdBuffer);
}
| UTEXTUREBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, EsdBuffer);
}
| TEXTURE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd2D, false, false, true);
}
| F16TEXTURE2DMS {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true);
}
| ITEXTURE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd2D, false, false, true);
}
| UTEXTURE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd2D, false, false, true);
}
| TEXTURE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, Esd2D, true, false, true);
}
| F16TEXTURE2DMSARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true);
}
| ITEXTURE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, Esd2D, true, false, true);
}
| UTEXTURE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, Esd2D, true, false, true);
}
| IMAGE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd1D);
}
| F16IMAGE1D {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd1D);
}
| IIMAGE1D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2993,17 +3051,12 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtUint, Esd1D);
}
| IMAGE2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd2D);
}
| F16IMAGE2D {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D);
}
| IIMAGE2D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3019,12 +3072,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd3D);
}
| F16IMAGE3D {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd3D);
}
| IIMAGE3D {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3040,12 +3087,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, EsdRect);
}
| F16IMAGE2DRECT {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdRect);
}
| IIMAGE2DRECT {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3061,12 +3102,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, EsdCube);
}
| F16IMAGECUBE {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdCube);
}
| IIMAGECUBE {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3082,12 +3117,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, EsdBuffer);
}
| F16IMAGEBUFFER {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdBuffer);
}
| IIMAGEBUFFER {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3103,12 +3132,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd1D, true);
}
| F16IMAGE1DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd1D, true);
}
| IIMAGE1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3124,12 +3147,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd2D, true);
}
| F16IMAGE2DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D, true);
}
| IIMAGE2DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3145,12 +3162,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, EsdCube, true);
}
| F16IMAGECUBEARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdCube, true);
}
| IIMAGECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3166,12 +3177,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd2D, false, false, true);
}
| F16IMAGE2DMS {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D, false, false, true);
}
| IIMAGE2DMS {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3187,12 +3192,6 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat, Esd2D, true, false, true);
}
| F16IMAGE2DMSARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D, true, false, true);
}
| IIMAGE2DMSARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3203,6 +3202,74 @@ type_specifier_nonarray
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtUint, Esd2D, true, false, true);
}
| F16IMAGE1D {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd1D);
}
| F16IMAGE2D {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D);
}
| F16IMAGE3D {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd3D);
}
| F16IMAGE2DRECT {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdRect);
}
| F16IMAGECUBE {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdCube);
}
| F16IMAGEBUFFER {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdBuffer);
}
| F16IMAGE1DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd1D, true);
}
| F16IMAGE2DARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D, true);
}
| F16IMAGECUBEARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, EsdCube, true);
}
| F16IMAGE2DMS {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D, false, false, true);
}
| F16IMAGE2DMSARRAY {
parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setImage(EbtFloat16, Esd2D, true, false, true);
}
| SAMPLEREXTERNALOES { // GL_OES_EGL_image_external
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -3215,6 +3282,7 @@ type_specifier_nonarray
$$.sampler.set(EbtFloat, Esd2D);
$$.sampler.yuv = true;
}
| SUBPASSINPUT {
parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
@ -3284,6 +3352,7 @@ type_specifier_nonarray
$$.coopmat = true;
}
| struct_specifier {
$$ = $1;
$$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@ -3485,11 +3554,14 @@ simple_statement
| iteration_statement { $$ = $1; }
| jump_statement { $$ = $1; }
| demote_statement { $$ = $1; }
;
demote_statement
: DEMOTE SEMICOLON {
parseContext.requireStage($1.loc, EShLangFragment, "demote");
@ -3499,6 +3571,7 @@ demote_statement
;
compound_statement
: LEFT_BRACE RIGHT_BRACE { $$ = 0; }
| LEFT_BRACE {
@ -3885,4 +3958,3 @@ single_attribute
%%