mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-25 21:10:04 +00:00
spirv-val: Label VUID 06491 (#4745)
This commit is contained in:
parent
0b8426346d
commit
273d2a45ad
@ -326,17 +326,20 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec,
|
||||
case SpvDecorationLocation:
|
||||
case SpvDecorationComponent:
|
||||
// Location is used for input, output and ray tracing stages.
|
||||
if (sc == SpvStorageClassStorageBuffer ||
|
||||
sc == SpvStorageClassUniform ||
|
||||
sc == SpvStorageClassUniformConstant ||
|
||||
sc == SpvStorageClassWorkgroup || sc == SpvStorageClassPrivate ||
|
||||
sc == SpvStorageClassFunction) {
|
||||
if (sc != SpvStorageClassInput && sc != SpvStorageClassOutput &&
|
||||
sc != SpvStorageClassRayPayloadKHR &&
|
||||
sc != SpvStorageClassIncomingRayPayloadKHR &&
|
||||
sc != SpvStorageClassHitAttributeKHR &&
|
||||
sc != SpvStorageClassCallableDataKHR &&
|
||||
sc != SpvStorageClassIncomingCallableDataKHR &&
|
||||
sc != SpvStorageClassShaderRecordBufferKHR) {
|
||||
return _.diag(SPV_ERROR_INVALID_ID, target)
|
||||
<< LogStringForDecoration(dec)
|
||||
<< " decoration must not be applied to this storage class";
|
||||
}
|
||||
break;
|
||||
case SpvDecorationIndex:
|
||||
// Langauge from SPIR-V definition of Index
|
||||
if (sc != SpvStorageClassOutput) {
|
||||
return fail(0) << "must be in the Output storage class";
|
||||
}
|
||||
@ -346,8 +349,8 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec,
|
||||
if (sc != SpvStorageClassStorageBuffer &&
|
||||
sc != SpvStorageClassUniform &&
|
||||
sc != SpvStorageClassUniformConstant) {
|
||||
return fail(0) << "must be in the StorageBuffer, Uniform, or "
|
||||
"UniformConstant storage class";
|
||||
return fail(6491) << "must be in the StorageBuffer, Uniform, or "
|
||||
"UniformConstant storage class";
|
||||
}
|
||||
break;
|
||||
case SpvDecorationInputAttachmentIndex:
|
||||
|
@ -1896,6 +1896,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-Location-04918);
|
||||
case 4919:
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-Location-04919);
|
||||
case 6491:
|
||||
return VUID_WRAP(VUID-StandaloneSpirv-DescriptorSet-06491);
|
||||
default:
|
||||
return ""; // unknown id
|
||||
}
|
||||
|
@ -793,6 +793,8 @@ OpFunctionEnd
|
||||
|
||||
CompileSuccessfully(text, SPV_ENV_VULKAN_1_0);
|
||||
EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
|
||||
EXPECT_THAT(getDiagnosticString(),
|
||||
HasSubstr("VUID-StandaloneSpirv-DescriptorSet-06491"));
|
||||
EXPECT_THAT(getDiagnosticString(),
|
||||
HasSubstr("must be in the StorageBuffer, Uniform, or "
|
||||
"UniformConstant storage class"));
|
||||
|
Loading…
Reference in New Issue
Block a user