spirv-val: Add VUID label for 07703 (#4980)

This commit is contained in:
Spencer Fricke 2022-11-07 09:05:25 +09:00 коммит произвёл GitHub
Родитель d35a78db57
Коммит a5e766b2b4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -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";
}

Просмотреть файл

@ -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
}

Просмотреть файл

@ -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"));