Web: Remove/rationalize a set of *_EXTENSIONS, using GLSLANG_WEB.

Focus was on the front end (not SPIR-V), minus the grammar.
Reduces #ifdef count by around 320 and makes the web build 270K smaller,
which is about 90% the  target size.

The grammar and scanner will be another step, as will the SPIR-V backend.
This makes heavy use of methods #ifdef'd to return false as a global way
of turning off code, relying on C++ DCE to do the rest.
This commit is contained in:
John Kessenich
2019-08-01 03:28:08 -06:00
parent e66dace97e
commit 7015bd658e
32 changed files with 2661 additions and 2712 deletions

View File

@@ -257,7 +257,6 @@ const char* GetBinaryName(EShLanguage stage)
case EShLangGeometry: name = "geom.spv"; break;
case EShLangFragment: name = "frag.spv"; break;
case EShLangCompute: name = "comp.spv"; break;
#ifdef NV_EXTENSIONS
case EShLangRayGenNV: name = "rgen.spv"; break;
case EShLangIntersectNV: name = "rint.spv"; break;
case EShLangAnyHitNV: name = "rahit.spv"; break;
@@ -266,7 +265,6 @@ const char* GetBinaryName(EShLanguage stage)
case EShLangCallableNV: name = "rcall.spv"; break;
case EShLangMeshNV: name = "mesh.spv"; break;
case EShLangTaskNV: name = "task.spv"; break;
#endif
default: name = "unknown"; break;
}
} else
@@ -1389,7 +1387,6 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
return EShLangFragment;
else if (stageName == "comp")
return EShLangCompute;
#ifdef NV_EXTENSIONS
else if (stageName == "rgen")
return EShLangRayGenNV;
else if (stageName == "rint")
@@ -1406,7 +1403,6 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
return EShLangMeshNV;
else if (stageName == "task")
return EShLangTaskNV;
#endif
usage();
return EShLangVertex;
@@ -1476,7 +1472,6 @@ void usage()
" .geom for a geometry shader\n"
" .frag for a fragment shader\n"
" .comp for a compute shader\n"
#ifdef NV_EXTENSIONS
" .mesh for a mesh shader\n"
" .task for a task shader\n"
" .rgen for a ray generation shader\n"
@@ -1485,7 +1480,6 @@ void usage()
" .rchit for a ray closest hit shader\n"
" .rmiss for a ray miss shader\n"
" .rcall for a ray callable shader\n"
#endif
" .glsl for .vert.glsl, .tesc.glsl, ..., .comp.glsl compound suffixes\n"
" .hlsl for .vert.hlsl, .tesc.hlsl, ..., .comp.hlsl compound suffixes\n"
"\n"