spirv-val: Add VUID label for 07703 (#4980)
diff --git a/source/val/validate_decorations.cpp b/source/val/validate_decorations.cpp
index 55a2681..ef9753d 100644
--- a/source/val/validate_decorations.cpp
+++ b/source/val/validate_decorations.cpp
@@ -1718,6 +1718,7 @@
} 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 bb33fb5..07dc042 100644
--- a/source/val/validation_state.cpp
+++ b/source/val/validation_state.cpp
@@ -2160,6 +2160,8 @@
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 64ab8d0..ff62f4b 100644
--- a/test/val/val_decoration_test.cpp
+++ b/test/val/val_decoration_test.cpp
@@ -7195,6 +7195,8 @@
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"));
}