Skip to content

Commit ee39b5d

Browse files
spirv-val: Add Vulkan Addressing Model check (#4107)
1 parent 9150cd4 commit ee39b5d

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

source/val/validate_mode_setting.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,15 @@ spv_result_t ValidateMemoryModel(ValidationState_t& _,
498498
}
499499
}
500500

501+
if (spvIsVulkanEnv(_.context()->target_env)) {
502+
if ((_.addressing_model() != SpvAddressingModelLogical) &&
503+
(_.addressing_model() != SpvAddressingModelPhysicalStorageBuffer64)) {
504+
return _.diag(SPV_ERROR_INVALID_DATA, inst)
505+
<< _.VkErrorID(4635)
506+
<< "Addressing model must be Logical or PhysicalStorageBuffer64 "
507+
<< "in the Vulkan environment.";
508+
}
509+
}
501510
return SPV_SUCCESS;
502511
}
503512

source/val/validation_state.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
16501650
return VUID_WRAP(VUID-ShadingRateKHR-ShadingRateKHR-04492);
16511651
case 4633:
16521652
return VUID_WRAP(VUID-StandaloneSpirv-None-04633);
1653+
case 4635:
1654+
return VUID_WRAP(VUID-StandaloneSpirv-None-04635);
16531655
case 4642:
16541656
return VUID_WRAP(VUID-StandaloneSpirv-None-04642);
16551657
case 4649:

0 commit comments

Comments
 (0)