| 531 | } |
| 532 | |
| 533 | spv_result_t ValidateKernelDecl(ValidationState_t& _, const Instruction* inst) { |
| 534 | const auto decl_id = inst->GetOperandAs<uint32_t>(4); |
| 535 | const auto decl = _.FindDef(decl_id); |
| 536 | if (!decl || !spvIsExtendedInstruction(decl->opcode())) { |
| 537 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 538 | << "Kernel must be a Kernel extended instruction"; |
| 539 | } |
| 540 | |
| 541 | if (decl->GetOperandAs<uint32_t>(2) != inst->GetOperandAs<uint32_t>(2)) { |
| 542 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 543 | << "Kernel must be from the same extended instruction import"; |
| 544 | } |
| 545 | |
| 546 | const auto ext_inst = |
| 547 | decl->GetOperandAs<NonSemanticClspvReflectionInstructions>(3); |
| 548 | if (ext_inst != NonSemanticClspvReflectionKernel) { |
| 549 | return _.diag(SPV_ERROR_INVALID_ID, inst) |
| 550 | << "Kernel must be a Kernel extended instruction"; |
| 551 | } |
| 552 | |
| 553 | return SPV_SUCCESS; |
| 554 | } |
| 555 | |
| 556 | spv_result_t ValidateArgInfo(ValidationState_t& _, const Instruction* inst, |
| 557 | uint32_t info_index) { |
no test coverage detected