Web: Selectively remove a few key features, using #ifndef GLSLANG_WEB
Save about 100K.
N.B.: This is done by eliminating a function call, at a high level,
not by #ifdef'ing a bunch of code.
Also, removed no longer needed *_EXTENSION #ifdef in the code not
needed by GLSLANG_WEB.
diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index 6af00dc..68cb8e9 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -146,11 +146,13 @@
{
if (ConfigFile.size() == 0)
Resources = glslang::DefaultTBuiltInResource;
+#ifndef GLSLANG_WEB
else {
char* configString = ReadFileData(ConfigFile.c_str());
glslang::DecodeResourceLimits(&Resources, configString);
FreeFileData(configString);
}
+#endif
}
int ReflectOptions = EShReflectionDefault;
@@ -1118,8 +1120,10 @@
} else {
glslang::OutputSpvBin(spirv, GetBinaryName((EShLanguage)stage));
}
+#ifndef GLSLANG_WEB
if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv))
spv::Disassemble(std::cout, spirv);
+#endif
}
}
}
@@ -1207,11 +1211,13 @@
workList.add(item.get());
});
+#ifndef GLSLANG_WEB
if (Options & EOptionDumpConfig) {
printf("%s", glslang::GetDefaultTBuiltInResourceString().c_str());
if (workList.empty())
return ESuccess;
}
+#endif
if (Options & EOptionDumpBareVersion) {
printf("%d.%d.%d\n",