From a5e766b2b47cf59f27b69761e9cc4298eec38528 Mon Sep 17 00:00:00 2001 From: Spencer Fricke <115671160+spencer-lunarg@users.noreply.github.com> Date: Mon, 7 Nov 2022 09:05:25 +0900 Subject: spirv-val: Add VUID label for 07703 (#4980) --- source/val/validate_decorations.cpp | 1 + source/val/validation_state.cpp | 2 ++ test/val/val_decoration_test.cpp | 2 ++ 3 files changed, 5 insertions(+) diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp index 55a2681d6..ef9753da4 100644 --- a/source/val/validate_decorations.cpp +++ b/source/val/validate_decorations.cpp @@ -1718,6 +1718,7 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate, } else if (bit_width == 64) { if (dimension > 2) { return vstate.diag(SPV_ERROR_INVALID_ID, &inst) + << vstate.VkErrorID(7703) << "Component decoration only allowed on 64-bit scalar and " "2-component vector"; } diff --git a/source/val/validation_state.cpp b/source/val/validation_state.cpp index bb33fb526..07dc04201 100644 --- a/source/val/validation_state.cpp +++ b/source/val/validation_state.cpp @@ -2160,6 +2160,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id, return VUID_WRAP(VUID-StandaloneSpirv-Base-07651); case 7652: return VUID_WRAP(VUID-StandaloneSpirv-Base-07652); + case 7703: + return VUID_WRAP(VUID-StandaloneSpirv-Component-07703); default: return ""; // unknown id } diff --git a/test/val/val_decoration_test.cpp b/test/val/val_decoration_test.cpp index 64ab8d05e..ff62f4b0c 100644 --- a/test/val/val_decoration_test.cpp +++ b/test/val/val_decoration_test.cpp @@ -7194,6 +7194,8 @@ TEST_F(ValidateDecorations, ComponentDecoration64VecWideBadVulkan) { CompileSuccessfully(spirv, env); EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateAndRetrieveValidationState(env)); + EXPECT_THAT(getDiagnosticString(), + AnyVUID("VUID-StandaloneSpirv-Component-07703")); EXPECT_THAT(getDiagnosticString(), HasSubstr("Component decoration only allowed on 64-bit scalar " "and 2-component vector")); -- cgit v1.2.3