Vulkan: Finish semantics for what creates spec-const-semantics.
Note: This required adding a new test mode to see the AST for vulkan tests. This also required reworking some deeper parts of type creation, regarding when storage qualification and constness is deduced bottom-up or dictated top-down.
This commit is contained in:
@@ -43,6 +43,7 @@ namespace {
|
||||
|
||||
using CompileToSpirvTest = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using VulkanSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
using VulkanAstSemantics = GlslangTest<::testing::TestWithParam<std::string>>;
|
||||
|
||||
// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully
|
||||
// generate SPIR-V.
|
||||
@@ -62,6 +63,14 @@ TEST_P(VulkanSemantics, FromFile)
|
||||
Target::Spv);
|
||||
}
|
||||
|
||||
// GLSL-level Vulkan semantics test that need to see the AST for validation.
|
||||
TEST_P(VulkanAstSemantics, FromFile)
|
||||
{
|
||||
loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(),
|
||||
Source::GLSL, Semantics::Vulkan,
|
||||
Target::AST);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, CompileToSpirvTest,
|
||||
@@ -187,6 +196,14 @@ INSTANTIATE_TEST_CASE_P(
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Glsl, VulkanAstSemantics,
|
||||
::testing::ValuesIn(std::vector<std::string>({
|
||||
"vulkan.ast.vert",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
);
|
||||
// clang-format on
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
@@ -94,7 +94,7 @@ EShMessages DeriveOptions(Source source, Semantics semantics, Target target)
|
||||
case Semantics::OpenGL:
|
||||
break;
|
||||
case Semantics::Vulkan:
|
||||
result = static_cast<EShMessages>(result | EShMsgVulkanRules);
|
||||
result = static_cast<EShMessages>(result | EShMsgVulkanRules | EShMsgSpvRules);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user