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:
@@ -283,6 +283,8 @@ spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile
|
||||
{
|
||||
#ifdef GLSLANG_WEB
|
||||
return spv::SourceLanguageESSL;
|
||||
#elif defined(GLSLANG_ANGLE)
|
||||
return spv::SourceLanguageGLSL;
|
||||
#endif
|
||||
|
||||
switch (source) {
|
||||
@@ -8694,7 +8696,7 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName)
|
||||
// Write SPIR-V out to a text file with 32-bit hexadecimal words
|
||||
void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName)
|
||||
{
|
||||
#ifndef GLSLANG_WEB
|
||||
#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
|
||||
std::ofstream out;
|
||||
out.open(baseName, std::ios::binary | std::ios::out);
|
||||
if (out.fail())
|
||||
|
||||
Reference in New Issue
Block a user