Use GLSLANG_ANGLE to strip features to what ANGLE requires
authorShahbaz Youssefi <ShabbyX@gmail.com>
Fri, 3 Jul 2020 19:42:53 +0000 (15:42 -0400)
committerShahbaz Youssefi <ShabbyX@gmail.com>
Wed, 8 Jul 2020 19:33:20 +0000 (15:33 -0400)
commit8c49d15fbf4f7857c1f32a7b39ded0a99da660d3
treea079007a1605f75d5bbd62ebc8c60873408055f5
parentf5ed7a69d5d64bd3ac802712c24995c6c12d23f8
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>
17 files changed:
BUILD.gn
SPIRV/GlslangToSpv.cpp
glslang/MachineIndependent/Initialize.cpp
glslang/MachineIndependent/ShaderLang.cpp
glslang/MachineIndependent/SymbolTable.cpp
glslang/MachineIndependent/SymbolTable.h
glslang/MachineIndependent/intermOut.cpp
glslang/MachineIndependent/iomapper.cpp
glslang/MachineIndependent/iomapper.h
glslang/MachineIndependent/linkValidate.cpp
glslang/MachineIndependent/localintermediate.h
glslang/MachineIndependent/parseVersions.h
glslang/MachineIndependent/reflection.cpp
glslang/MachineIndependent/reflection.h
glslang/Public/ShaderLang.h
gtests/Link.FromFile.Vk.cpp
gtests/TestFixture.h