mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-26 21:30:07 +00:00
spirv-val: Label Layer and ViewportIndex VUIDs (#4013)
This commit is contained in:
parent
0c036df288
commit
650acb575b
@ -2603,17 +2603,19 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
|
||||
assert(function_id_ == 0);
|
||||
for (const auto em :
|
||||
{SpvExecutionModelVertex, SpvExecutionModelTessellationEvaluation,
|
||||
SpvExecutionModelGeometry}) {
|
||||
SpvExecutionModelGeometry, SpvExecutionModelMeshNV}) {
|
||||
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
|
||||
std::bind(&BuiltInsValidator::ValidateNotCalledWithExecutionModel,
|
||||
this,
|
||||
"Vulkan spec doesn't allow BuiltIn Layer and "
|
||||
"ViewportIndex to be "
|
||||
"used for variables with Input storage class if "
|
||||
"execution model is Vertex, TessellationEvaluation, or "
|
||||
"Geometry.",
|
||||
em, decoration, built_in_inst, referenced_from_inst,
|
||||
std::placeholders::_1));
|
||||
std::bind(
|
||||
&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this,
|
||||
std::string(
|
||||
_.VkErrorID((operand == SpvBuiltInLayer) ? 4274 : 4406) +
|
||||
"Vulkan spec doesn't allow BuiltIn Layer and "
|
||||
"ViewportIndex to be "
|
||||
"used for variables with Input storage class if "
|
||||
"execution model is Vertex, TessellationEvaluation, "
|
||||
"Geometry, or MeshNV."),
|
||||
em, decoration, built_in_inst, referenced_from_inst,
|
||||
std::placeholders::_1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2621,11 +2623,12 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
|
||||
assert(function_id_ == 0);
|
||||
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
|
||||
&BuiltInsValidator::ValidateNotCalledWithExecutionModel, this,
|
||||
"Vulkan spec doesn't allow BuiltIn Layer and "
|
||||
"ViewportIndex to be "
|
||||
"used for variables with Output storage class if "
|
||||
"execution model is "
|
||||
"Fragment.",
|
||||
std::string(_.VkErrorID((operand == SpvBuiltInLayer) ? 4275 : 4407) +
|
||||
"Vulkan spec doesn't allow BuiltIn Layer and "
|
||||
"ViewportIndex to be "
|
||||
"used for variables with Output storage class if "
|
||||
"execution model is "
|
||||
"Fragment."),
|
||||
SpvExecutionModelFragment, decoration, built_in_inst,
|
||||
referenced_from_inst, std::placeholders::_1));
|
||||
}
|
||||
|
@ -1377,6 +1377,10 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
|
||||
return VUID_WRAP(VUID-InstanceIndex-InstanceIndex-04265);
|
||||
case 4272:
|
||||
return VUID_WRAP(VUID-Layer-Layer-04272);
|
||||
case 4274:
|
||||
return VUID_WRAP(VUID-Layer-Layer-04274);
|
||||
case 4275:
|
||||
return VUID_WRAP(VUID-Layer-Layer-04275);
|
||||
case 4276:
|
||||
return VUID_WRAP(VUID-Layer-Layer-04276);
|
||||
case 4281:
|
||||
@ -1469,6 +1473,10 @@ 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 4406:
|
||||
return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-04406);
|
||||
case 4407:
|
||||
return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-04407);
|
||||
case 4408:
|
||||
return VUID_WRAP(VUID-ViewportIndex-ViewportIndex-04408);
|
||||
case 4422:
|
||||
|
@ -1263,7 +1263,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
ValidateVulkanCombineBuiltInExecutionModelDataTypeResult,
|
||||
Combine(
|
||||
Values("Layer", "ViewportIndex"), Values("Fragment"), Values("Output"),
|
||||
Values("%u32"), Values(nullptr),
|
||||
Values("%u32"),
|
||||
Values("VUID-Layer-Layer-04275 VUID-ViewportIndex-ViewportIndex-04407"),
|
||||
Values(TestResult(SPV_ERROR_INVALID_DATA,
|
||||
"Output storage class if execution model is Fragment",
|
||||
"which is called with execution model Fragment"))));
|
||||
@ -1274,10 +1275,11 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
Combine(
|
||||
Values("Layer", "ViewportIndex"),
|
||||
Values("Vertex", "TessellationEvaluation", "Geometry"), Values("Input"),
|
||||
Values("%u32"), Values(nullptr),
|
||||
Values("%u32"),
|
||||
Values("VUID-Layer-Layer-04274 VUID-ViewportIndex-ViewportIndex-04406"),
|
||||
Values(TestResult(SPV_ERROR_INVALID_DATA,
|
||||
"Input storage class if execution model is Vertex, "
|
||||
"TessellationEvaluation, or Geometry",
|
||||
"TessellationEvaluation, Geometry, or MeshNV",
|
||||
"which is called with execution model"))));
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
|
Loading…
Reference in New Issue
Block a user