Use GLSLANG_ANGLE to strip features to what ANGLE requires

This change strips a few features similar to GLSLANG_WEB but doesn't
remove every detail like the latter.  It also hardcodes profile/version
to core/450.

In particular, TBuiltIns::initialize is specialized to remove most of
what is not supported or won't be supported by ANGLE.  The result of
this function is parsed with TParseContext::parseShaderStrings which is
a performance bottleneck.

This change shaves about 300KB off of ANGLE's binary size and reduces
the cost of SetupBuiltinSymbolTable to nearly a sixth.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
This commit is contained in:
Shahbaz Youssefi 2020-07-03 15:42:53 -04:00
parent 7ab4564696
commit 1ef2e250fc
No known key found for this signature in database
GPG key ID: C6149357EC6727E0
17 changed files with 214 additions and 102 deletions

View file

@ -253,7 +253,7 @@ public:
glslang::TProgram program;
program.addShader(&shader);
success &= program.link(controls);
#ifndef GLSLANG_WEB
#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if (success)
program.mapIO();
#endif
@ -315,7 +315,7 @@ public:
program.addShader(&shader);
success &= program.link(controls);
#ifndef GLSLANG_WEB
#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if (success)
program.mapIO();
#endif
@ -360,7 +360,7 @@ public:
glslang::TProgram program;
program.addShader(&shader);
success &= program.link(controls);
#ifndef GLSLANG_WEB
#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
if (success)
program.mapIO();
#endif