Skip to content

Commit 281fecf

Browse files
spirv-val: Label LongVector VUID (KhronosGroup#6581)
We decided today to move these to Standalone VUID https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/8106/diffs
1 parent 6e9d60d commit 281fecf

6 files changed

Lines changed: 19 additions & 7 deletions

File tree

source/val/validate_memory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
887887
return false;
888888
})) {
889889
return _.diag(SPV_ERROR_INVALID_ID, inst)
890+
<< _.VkErrorID(12297)
890891
<< "Long vector types with more than 4 components (or types "
891892
"containing them) not supported in storage class "
892893
<< StorageClassToString(storage_class);

source/val/validate_type.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ spv_result_t ValidateTypeVector(ValidationState_t& _, const Instruction* inst) {
227227
return SPV_SUCCESS;
228228
}
229229
return _.diag(SPV_ERROR_INVALID_DATA, inst)
230-
<< "Having " << num_components << " components for "
231-
<< spvOpcodeString(inst->opcode())
232-
<< " requires the Vector16 capability";
230+
<< _.VkErrorID(12295) << "Having " << num_components
231+
<< " components for " << spvOpcodeString(inst->opcode())
232+
<< " requires the Vector16 or LongVectorEXT capability";
233233
} else {
234234
return _.diag(SPV_ERROR_INVALID_DATA, inst)
235-
<< "Illegal number of components (" << num_components << ") for "
236-
<< spvOpcodeString(inst->opcode());
235+
<< _.VkErrorID(12295) << "Illegal number of components ("
236+
<< num_components << ") for " << spvOpcodeString(inst->opcode());
237237
}
238238

239239
return SPV_SUCCESS;

source/val/validation_state.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,10 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
29612961
return VUID_WRAP(VUID-StandaloneSpirv-Scope-12243);
29622962
case 12294:
29632963
return VUID_WRAP(VUID-StandaloneSpirv-Function-12294);
2964+
case 12295:
2965+
return VUID_WRAP(VUID-StandaloneSpirv-None-12295);
2966+
case 12297:
2967+
return VUID_WRAP(VUID-StandaloneSpirv-Type-12297);
29642968
default:
29652969
return ""; // unknown id
29662970
}

test/val/val_data_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ std::string header_with_float64_bfloat16 = R"(
140140
)";
141141

142142
std::string invalid_comp_error = "Illegal number of components";
143-
std::string missing_cap_error = "requires the Vector16 capability";
143+
std::string missing_cap_error =
144+
"requires the Vector16 or LongVectorEXT capability";
144145
std::string missing_int8_cap_error = "requires the Int8 capability";
145146
std::string missing_int16_cap_error =
146147
"requires the Int16 capability,"

test/val/val_id_test.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,8 @@ TEST_P(ValidateIdWithMessage, OpTypeVectorColumnCountEightWithoutVector16Bad) {
761761
EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
762762
EXPECT_THAT(getDiagnosticString(),
763763
HasSubstr(make_message(
764-
"Having 8 components for TypeVector requires the Vector16 "
764+
"Having 8 components for TypeVector requires the Vector16 or "
765+
"LongVectorEXT "
765766
"capability\n %v8float = OpTypeVector %float 8\n")));
766767
}
767768

@@ -776,6 +777,7 @@ TEST_P(ValidateIdWithMessage,
776777
EXPECT_THAT(getDiagnosticString(),
777778
HasSubstr(make_message(
778779
"Having 16 components for TypeVector requires the Vector16 "
780+
"or LongVectorEXT "
779781
"capability\n %v16float = OpTypeVector %float 16\n")));
780782
}
781783

test/val/val_memory_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10357,6 +10357,8 @@ OpFunctionEnd
1035710357
getDiagnosticString(),
1035810358
HasSubstr("Long vector types with more than 4 components (or types "
1035910359
"containing them) not supported in storage class Input"));
10360+
EXPECT_THAT(getDiagnosticString(),
10361+
AnyVUID("VUID-StandaloneSpirv-Type-12297"));
1036010362
}
1036110363

1036210364
TEST_F(ValidateMemory, LongVectorMissingCapabilityBad) {
@@ -10379,6 +10381,8 @@ OpFunctionEnd
1037910381
EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_1));
1038010382
EXPECT_THAT(getDiagnosticString(),
1038110383
HasSubstr("Illegal number of components (5) for TypeVector"));
10384+
EXPECT_THAT(getDiagnosticString(),
10385+
AnyVUID("VUID-StandaloneSpirv-None-12295"));
1038210386
}
1038310387

1038410388
} // namespace

0 commit comments

Comments
 (0)