MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / ValidateVariableCoopMat

Function ValidateVariableCoopMat

source/val/validate_memory.cpp:770–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770spv_result_t ValidateVariableCoopMat(ValidationState_t& _,
771 const Instruction* inst,
772 spv::StorageClass storage_class,
773 const Instruction& pointee) {
774 // Cooperative matrix types can only be allocated in Function or Private
775 if ((storage_class != spv::StorageClass::Function &&
776 storage_class != spv::StorageClass::Private) &&
777 _.ContainsType(pointee.id(), [](const Instruction* type_inst) {
778 auto opcode = type_inst->opcode();
779 return opcode == spv::Op::OpTypeCooperativeMatrixNV ||
780 opcode == spv::Op::OpTypeCooperativeMatrixKHR;
781 })) {
782 return _.diag(SPV_ERROR_INVALID_ID, inst)
783 << "Cooperative matrix types (or types containing them) can only be "
784 "allocated "
785 << "in Function or Private storage classes or as function "
786 "parameters";
787 }
788
789 return SPV_SUCCESS;
790}
791
792// Vulkan specific validation rules for OpTypeRuntimeArray
793spv_result_t ValidateVariableVulkanArray(ValidationState_t& _,

Callers 1

ValidateVariableFunction · 0.85

Calls 4

ContainsTypeMethod · 0.80
diagMethod · 0.80
idMethod · 0.45
opcodeMethod · 0.45

Tested by

no test coverage detected