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:
@@ -72,12 +72,8 @@ using OpenGLSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using HlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
using GlslIoMap = GlslangTest<::testing::TestWithParam<IoMapData>>;
|
||||
#ifdef AMD_EXTENSIONS
|
||||
using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
#endif
|
||||
#ifdef NV_EXTENSIONS
|
||||
using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
#endif
|
||||
using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
|
||||
@@ -179,7 +175,6 @@ TEST_P(GlslIoMap, FromFile)
|
||||
GetParam().flattenUniforms);
|
||||
}
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics (AMD extensions enabled).
|
||||
// Expected to successfully generate SPIR-V.
|
||||
TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
|
||||
@@ -188,9 +183,7 @@ TEST_P(CompileVulkanToSpirvTestAMD, FromFile)
|
||||
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
|
||||
Target::Spv);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics (NV extensions enabled).
|
||||
// Expected to successfully generate SPIR-V.
|
||||
TEST_P(CompileVulkanToSpirvTestNV, FromFile)
|
||||
@@ -199,7 +192,6 @@ TEST_P(CompileVulkanToSpirvTestNV, FromFile)
|
||||
Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_0, glslang::EShTargetSpv_1_0,
|
||||
Target::Spv);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile)
|
||||
{
|
||||
@@ -572,7 +564,6 @@ INSTANTIATE_TEST_CASE_P(
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
#ifdef AMD_EXTENSIONS
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, CompileVulkanToSpirvTestAMD,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
@@ -588,9 +579,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef NV_EXTENSIONS
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, CompileVulkanToSpirvTestNV,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
@@ -638,7 +627,6 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
#endif
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest,
|
||||
|
||||
Reference in New Issue
Block a user