| 768 | } |
| 769 | |
| 770 | spv_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 |
| 793 | spv_result_t ValidateVariableVulkanArray(ValidationState_t& _, |
no test coverage detected