diff options
Diffstat (limited to '3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4')
-rw-r--r-- | 3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 | 258 |
1 files changed, 126 insertions, 132 deletions
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 index 6ace0380415..20f2ba40dfa 100644 --- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 +++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 @@ -38,7 +38,7 @@ // // Do not edit the .y file, only edit the .m4 file. -// The .y bison file is not a source file, it is a derivitive of the .m4 file. +// The .y bison file is not a source file, it is a derivative of the .m4 file. // The m4 file needs to be processed by m4 to generate the .y bison file. // // Code sandwiched between a pair: @@ -49,7 +49,7 @@ // ... // GLSLANG_WEB_EXCLUDE_OFF // -// Will be exluded from the grammar when m4 is executed as: +// Will be excluded from the grammar when m4 is executed as: // // m4 -P -DGLSLANG_WEB // @@ -166,8 +166,12 @@ extern int yylex(YYSTYPE*, TParseContext&); %token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE %token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D %token <lex> USAMPLERCUBE USAMPLER2DARRAY -%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW -%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY + +// separate image/sampler +%token <lex> SAMPLER SAMPLERSHADOW +%token <lex> TEXTURE2D TEXTURE3D TEXTURECUBE TEXTURE2DARRAY +%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY +%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY GLSLANG_WEB_EXCLUDE_ON @@ -203,6 +207,8 @@ GLSLANG_WEB_EXCLUDE_ON %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 @@ -233,18 +239,12 @@ GLSLANG_WEB_EXCLUDE_ON %token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY %token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY -// pure sampler -%token <lex> SAMPLER SAMPLERSHADOW - // texture without sampler -%token <lex> TEXTURE1D TEXTURE2D TEXTURE3D TEXTURECUBE -%token <lex> TEXTURE1DARRAY TEXTURE2DARRAY -%token <lex> ITEXTURE1D ITEXTURE2D ITEXTURE3D ITEXTURECUBE -%token <lex> ITEXTURE1DARRAY ITEXTURE2DARRAY UTEXTURE1D UTEXTURE2D UTEXTURE3D -%token <lex> UTEXTURECUBE UTEXTURE1DARRAY UTEXTURE2DARRAY +%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY +%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D +%token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY %token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT %token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER -%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY %token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS %token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY @@ -277,7 +277,7 @@ GLSLANG_WEB_EXCLUDE_OFF %token <lex> CENTROID IN OUT INOUT %token <lex> STRUCT VOID WHILE %token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT -%token <lex> UNIFORM SHARED +%token <lex> UNIFORM SHARED BUFFER %token <lex> FLAT SMOOTH LAYOUT GLSLANG_WEB_EXCLUDE_ON @@ -285,7 +285,7 @@ GLSLANG_WEB_EXCLUDE_ON %token <lex> INT64CONSTANT UINT64CONSTANT %token <lex> SUBROUTINE DEMOTE %token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV -%token <lex> PATCH SAMPLE BUFFER NONUNIFORM +%token <lex> PATCH SAMPLE NONUNIFORM %token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT %token <lex> SUBGROUPCOHERENT NONPRIVATE %token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV @@ -1360,7 +1360,6 @@ storage_qualifier $$.init($1.loc); $$.qualifier.storage = EvqUniform; } -GLSLANG_WEB_EXCLUDE_ON | SHARED { parseContext.globalCheck($1.loc, "shared"); parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -1374,6 +1373,7 @@ GLSLANG_WEB_EXCLUDE_ON $$.init($1.loc); $$.qualifier.storage = EvqBuffer; } +GLSLANG_WEB_EXCLUDE_ON | ATTRIBUTE { parseContext.requireStage($1.loc, EShLangVertex, "attribute"); parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute"); @@ -2354,6 +2354,16 @@ GLSLANG_WEB_EXCLUDE_OFF $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdCube, false, true); } + | SAMPLER2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true); + } + | SAMPLER2DARRAYSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtFloat, Esd2D, true, true); + } GLSLANG_WEB_EXCLUDE_ON | SAMPLER1DSHADOW { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -2370,17 +2380,6 @@ GLSLANG_WEB_EXCLUDE_ON $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, Esd1D, true, true); } -GLSLANG_WEB_EXCLUDE_OFF - | SAMPLER2DARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, true); - } - | SAMPLER2DARRAYSHADOW { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.set(EbtFloat, Esd2D, true, true); - } | SAMPLERCUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2391,7 +2390,6 @@ GLSLANG_WEB_EXCLUDE_OFF $$.basicType = EbtSampler; $$.sampler.set(EbtFloat, EsdCube, true, true); } -GLSLANG_WEB_EXCLUDE_ON | F16SAMPLER1D { parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -2491,50 +2489,66 @@ GLSLANG_WEB_EXCLUDE_OFF $$.basicType = EbtSampler; $$.sampler.set(EbtInt, EsdCube); } -GLSLANG_WEB_EXCLUDE_ON - | ISAMPLER1DARRAY { + | ISAMPLER2DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtInt, Esd1D, true); + $$.sampler.set(EbtInt, Esd2D, true); } -GLSLANG_WEB_EXCLUDE_OFF - | ISAMPLER2DARRAY { + | USAMPLER2D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtInt, Esd2D, true); + $$.sampler.set(EbtUint, Esd2D); + } + | USAMPLER3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, Esd3D); + } + | USAMPLERCUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.set(EbtUint, EsdCube); + } +GLSLANG_WEB_EXCLUDE_ON + | 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); } -GLSLANG_WEB_EXCLUDE_ON | USAMPLER1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.set(EbtUint, Esd1D); } -GLSLANG_WEB_EXCLUDE_OFF - | USAMPLER2D { + | USAMPLER1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtUint, Esd2D); + $$.sampler.set(EbtUint, Esd1D, true); } - | USAMPLER3D { + | USAMPLERCUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtUint, Esd3D); + $$.sampler.set(EbtUint, EsdCube, true); } - | USAMPLERCUBE { + | TEXTURECUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtUint, EsdCube); + $$.sampler.setTexture(EbtFloat, EsdCube, true); } -GLSLANG_WEB_EXCLUDE_ON - | USAMPLER1DARRAY { + | ITEXTURECUBEARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtUint, Esd1D, true); + $$.sampler.setTexture(EbtInt, EsdCube, true); + } + | UTEXTURECUBEARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube, true); } GLSLANG_WEB_EXCLUDE_OFF | USAMPLER2DARRAY { @@ -2542,10 +2556,75 @@ GLSLANG_WEB_EXCLUDE_OFF $$.basicType = EbtSampler; $$.sampler.set(EbtUint, Esd2D, true); } - | USAMPLERCUBEARRAY { + | TEXTURE2D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; - $$.sampler.set(EbtUint, EsdCube, true); + $$.sampler.setTexture(EbtFloat, Esd2D); + } + | TEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd3D); + } + | TEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, Esd2D, true); + } + | TEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtFloat, EsdCube); + } + | ITEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D); + } + | ITEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd3D); + } + | ITEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, EsdCube); + } + | ITEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtInt, Esd2D, true); + } + | UTEXTURE2D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D); + } + | UTEXTURE3D { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd3D); + } + | UTEXTURECUBE { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, EsdCube); + } + | UTEXTURE2DARRAY { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setTexture(EbtUint, Esd2D, true); + } + | SAMPLER { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(false); + } + | SAMPLERSHADOW { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtSampler; + $$.sampler.setPureSampler(true); } GLSLANG_WEB_EXCLUDE_ON | SAMPLER2DRECT { @@ -2643,16 +2722,6 @@ GLSLANG_WEB_EXCLUDE_ON $$.basicType = EbtSampler; $$.sampler.set(EbtUint, Esd2D, true, false, true); } - | SAMPLER { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setPureSampler(false); - } - | SAMPLERSHADOW { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setPureSampler(true); - } | TEXTURE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; @@ -2664,33 +2733,18 @@ GLSLANG_WEB_EXCLUDE_ON $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat16, Esd1D); } - | TEXTURE2D { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtFloat, Esd2D); - } | F16TEXTURE2D { parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat16, Esd2D); } - | TEXTURE3D { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtFloat, Esd3D); - } | F16TEXTURE3D { parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat16, Esd3D); } - | TEXTURECUBE { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtFloat, EsdCube); - } | F16TEXTURECUBE { parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -2708,22 +2762,12 @@ GLSLANG_WEB_EXCLUDE_ON $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat16, Esd1D, true); } - | TEXTURE2DARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtFloat, Esd2D, true); - } | F16TEXTURE2DARRAY { parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtFloat16, Esd2D, true); } - | TEXTURECUBEARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtFloat, EsdCube, true); - } | F16TEXTURECUBEARRAY { parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -2735,71 +2779,21 @@ GLSLANG_WEB_EXCLUDE_ON $$.basicType = EbtSampler; $$.sampler.setTexture(EbtInt, Esd1D); } - | ITEXTURE2D { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtInt, Esd2D); - } - | ITEXTURE3D { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtInt, Esd3D); - } - | ITEXTURECUBE { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtInt, EsdCube); - } | ITEXTURE1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtInt, Esd1D, true); } - | ITEXTURE2DARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtInt, Esd2D, true); - } - | ITEXTURECUBEARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtInt, EsdCube, true); - } | UTEXTURE1D { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtUint, Esd1D); } - | UTEXTURE2D { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtUint, Esd2D); - } - | UTEXTURE3D { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtUint, Esd3D); - } - | UTEXTURECUBE { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtUint, EsdCube); - } | UTEXTURE1DARRAY { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; $$.sampler.setTexture(EbtUint, Esd1D, true); } - | UTEXTURE2DARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtUint, Esd2D, true); - } - | UTEXTURECUBEARRAY { - $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtSampler; - $$.sampler.setTexture(EbtUint, EsdCube, true); - } | TEXTURE2DRECT { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtSampler; |