Web: Add separate texture/sampler, exclude *CubeArray*.

Looks like will add about 1K compressed size to executable footprint.
This commit is contained in:
John Kessenich 2019-10-08 01:12:07 -06:00
parent 5e634c8999
commit 61c22e255d
11 changed files with 2316 additions and 8943 deletions

View file

@ -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
@ -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,30 +2489,11 @@ GLSLANG_WEB_EXCLUDE_OFF
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, EsdCube);
}
GLSLANG_WEB_EXCLUDE_ON
| ISAMPLER1DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, Esd1D, true);
}
GLSLANG_WEB_EXCLUDE_OFF
| ISAMPLER2DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.set(EbtInt, Esd2D, 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 {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
@ -2531,21 +2510,121 @@ GLSLANG_WEB_EXCLUDE_OFF
$$.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);
}
| 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;
$$.sampler.set(EbtUint, EsdCube, true);
}
| TEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtFloat, EsdCube, true);
}
| ITEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtInt, EsdCube, true);
}
| UTEXTURECUBEARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.basicType = EbtSampler;
$$.sampler.setTexture(EbtUint, EsdCube, true);
}
GLSLANG_WEB_EXCLUDE_OFF
| USAMPLER2DARRAY {
$$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
$$.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;