spirv-val: Add Vulkan Addressing Model check (#4107)

This commit is contained in:
sfricke-samsung 2021-01-15 06:35:17 -08:00 committed by GitHub
parent 9150cd441f
commit ee39b5db5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -498,6 +498,15 @@ spv_result_t ValidateMemoryModel(ValidationState_t& _,
}
}
if (spvIsVulkanEnv(_.context()->target_env)) {
if ((_.addressing_model() != SpvAddressingModelLogical) &&
(_.addressing_model() != SpvAddressingModelPhysicalStorageBuffer64)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4635)
<< "Addressing model must be Logical or PhysicalStorageBuffer64 "
<< "in the Vulkan environment.";
}
}
return SPV_SUCCESS;
}

View File

@ -1650,6 +1650,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-ShadingRateKHR-ShadingRateKHR-04492);
case 4633:
return VUID_WRAP(VUID-StandaloneSpirv-None-04633);
case 4635:
return VUID_WRAP(VUID-StandaloneSpirv-None-04635);
case 4642:
return VUID_WRAP(VUID-StandaloneSpirv-None-04642);
case 4649: