Add --no-link option
Adds the --no-link option which outputs the compiled shader binaries without linking them. This is a first step towards allowing users to create SPIR-v binary, non-executable libraries. When using the --no-link option, all functions are decorated with the Export linkage attribute.
This commit is contained in:
parent
a4aceb57de
commit
4c57db1595
24 changed files with 1671 additions and 1454 deletions
|
|
@ -65,6 +65,7 @@ std::string FileNameAsCustomTestSuffixIoMap(
|
|||
}
|
||||
|
||||
using CompileVulkanToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToSpirvTestNoLink = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToSpirvDeadCodeElimTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkanToDebugSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using CompileVulkan1_1ToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
|
|
@ -92,6 +93,16 @@ TEST_P(CompileVulkanToSpirvTest, FromFile)
|
|||
Target::Spv);
|
||||
}
|
||||
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics without linking. Expected to successfully generate SPIR-V.
|
||||
TEST_P(CompileVulkanToSpirvTestNoLink, FromFile)
|
||||
{
|
||||
options().compileOnly = true;
|
||||
// NOTE: Vulkan 1.3 is currently required to use the linkage capability
|
||||
// TODO(ncesario) make sure this is actually necessary
|
||||
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), Source::GLSL, Semantics::Vulkan,
|
||||
glslang::EShTargetVulkan_1_3, glslang::EShTargetSpv_1_0, Target::Spv);
|
||||
}
|
||||
|
||||
TEST_P(CompileVulkanToSpirvDeadCodeElimTest, FromFile)
|
||||
{
|
||||
loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(),
|
||||
|
|
@ -534,6 +545,14 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Glsl, CompileVulkanToSpirvTestNoLink,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
"spv.exportFunctions.comp",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
// Cases with deliberately unreachable code.
|
||||
// By default the compiler will aggressively eliminate
|
||||
// unreachable merges and continues.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue