spirv-val: Report VUID 08973 only in Vulkan environments (#5873)

The storage class restriction for `OpCooperativeMatrixLoadKHR` and
`OpCooperativeMatrixStoreKHR` comes from the Vulkan specification; as
such VUID 08973 should not be reported outside of Vulkan target
environments.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt 2024-11-11 17:18:45 +01:00 committed by GitHub
parent 9117e042b9
commit 384d527ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2115,6 +2115,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreKHR(ValidationState_t& _,
const auto storage_class =
pointer_type->GetOperandAs<spv::StorageClass>(storage_class_index);
if (spvIsVulkanEnv(_.context()->target_env)) {
if (storage_class != spv::StorageClass::Workgroup &&
storage_class != spv::StorageClass::StorageBuffer &&
storage_class != spv::StorageClass::PhysicalStorageBuffer) {
@ -2124,6 +2125,7 @@ spv_result_t ValidateCooperativeMatrixLoadStoreKHR(ValidationState_t& _,
<< _.getIdName(pointer_type_id)
<< " is not Workgroup, StorageBuffer, or PhysicalStorageBuffer.";
}
}
if (!untyped) {
const auto pointee_id = pointer_type->GetOperandAs<uint32_t>(2);