spirv-val: Add last ViewportIndex and Layer VUID (#4053)

This commit is contained in:
sfricke-samsung 2020-12-08 11:34:51 -08:00 committed by GitHub
parent 9df5225e67
commit 1a6b4053fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -2775,8 +2775,9 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
if (operand == SpvBuiltInLayer)
capability = "ShaderViewportIndexLayerEXT or ShaderLayer";
uint32_t vuid = (operand == SpvBuiltInLayer) ? 4273 : 4405;
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< "Using BuiltIn "
<< _.VkErrorID(vuid) << "Using BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
operand)
<< " in Vertex or Tessellation execution model requires the "

View File

@ -1419,6 +1419,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-LaunchSizeKHR-LaunchSizeKHR-04271);
case 4272:
return VUID_WRAP(VUID-Layer-Layer-04272);
case 4273:
return VUID_WRAP(VUID-Layer-Layer-04273);
case 4274:
return VUID_WRAP(VUID-Layer-Layer-04274);
case 4275:
@ -1553,6 +1555,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-ViewIndex-ViewIndex-04403);
case 4404:
return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-04404);
case 4405:
return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-04405);
case 4406:
return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-04406);
case 4407:

View File

@ -1256,7 +1256,8 @@ INSTANTIATE_TEST_SUITE_P(
ViewportIndexExecutionModelEnabledByCapability,
ValidateVulkanCombineBuiltInExecutionModelDataTypeResult,
Combine(Values("ViewportIndex"), Values("Vertex", "TessellationEvaluation"),
Values("Output"), Values("%u32"), Values(nullptr),
Values("Output"), Values("%u32"),
Values("VUID-ViewportIndex-ViewportIndex-04405"),
Values(TestResult(
SPV_ERROR_INVALID_DATA,
"ShaderViewportIndexLayerEXT or ShaderViewportIndex"))));
@ -1265,7 +1266,7 @@ INSTANTIATE_TEST_SUITE_P(
LayerExecutionModelEnabledByCapability,
ValidateVulkanCombineBuiltInExecutionModelDataTypeResult,
Combine(Values("Layer"), Values("Vertex", "TessellationEvaluation"),
Values("Output"), Values("%u32"), Values(nullptr),
Values("Output"), Values("%u32"), Values("VUID-Layer-Layer-04273"),
Values(TestResult(SPV_ERROR_INVALID_DATA,
"ShaderViewportIndexLayerEXT or ShaderLayer"))));