spirv-val: Label VUID 04634 (#4181)

This commit is contained in:
sfricke-samsung 2021-03-16 07:53:27 -07:00 committed by GitHub
parent 4100477e76
commit 03f23106c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,7 @@ spv_result_t ValidateEntryPoints(ValidationState_t& _) {
if (_.recursive_entry_points().find(entry_point) !=
_.recursive_entry_points().end()) {
return _.diag(SPV_ERROR_INVALID_BINARY, _.FindDef(entry_point))
<< _.VkErrorID(4634)
<< "Entry points may not have a call graph with cycles.";
}
}

View File

@ -1676,6 +1676,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-ShadingRateKHR-ShadingRateKHR-04492);
case 4633:
return VUID_WRAP(VUID-StandaloneSpirv-None-04633);
case 4634:
return VUID_WRAP(VUID-StandaloneSpirv-None-04634);
case 4635:
return VUID_WRAP(VUID-StandaloneSpirv-None-04635);
case 4638:

View File

@ -256,6 +256,8 @@ TEST_F(ValidationStateTest, CheckVulkanDirectlyRecursiveBodyBad) {
CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
EXPECT_THAT(getDiagnosticString(),
AnyVUID("VUID-StandaloneSpirv-None-04634"));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Entry points may not have a call graph with cycles.\n "
" %1 = OpFunction %void Pure|Const %3\n"));
@ -273,6 +275,8 @@ TEST_F(ValidationStateTest, CheckVulkanIndirectlyRecursiveBodyBad) {
CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
EXPECT_EQ(SPV_ERROR_INVALID_BINARY,
ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
EXPECT_THAT(getDiagnosticString(),
AnyVUID("VUID-StandaloneSpirv-None-04634"));
EXPECT_THAT(getDiagnosticString(),
HasSubstr("Entry points may not have a call graph with cycles.\n "
" %1 = OpFunction %void Pure|Const %3\n"));