From 03f23106c6468ee106bf1005fb9c1a0661820f06 Mon Sep 17 00:00:00 2001 From: sfricke-samsung <46493288+sfricke-samsung@users.noreply.github.com> Date: Tue, 16 Mar 2021 07:53:27 -0700 Subject: [PATCH] spirv-val: Label VUID 04634 (#4181) --- source/val/validate.cpp | 1 + source/val/validation_state.cpp | 2 ++ test/val/val_validation_state_test.cpp | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/source/val/validate.cpp b/source/val/validate.cpp index a2e116b13..45b6a463e 100644 --- a/source/val/validate.cpp +++ b/source/val/validate.cpp @@ -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."; } } diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp index f0ac0327d..514fc051e 100644 --- a/source/val/validation_state.cpp +++ b/source/val/validation_state.cpp @@ -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: diff --git a/test/val/val_validation_state_test.cpp b/test/val/val_validation_state_test.cpp index 7a38d3a16..3dd9e64a6 100644 --- a/test/val/val_validation_state_test.cpp +++ b/test/val/val_validation_state_test.cpp @@ -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"));