| 588 | } |
| 589 | |
| 590 | Instruction* AddFunctionCall(uint32_t result_type, uint32_t function, |
| 591 | const std::vector<uint32_t>& parameters) { |
| 592 | std::vector<Operand> operands; |
| 593 | operands.push_back({SPV_OPERAND_TYPE_ID, {function}}); |
| 594 | for (uint32_t id : parameters) { |
| 595 | operands.push_back({SPV_OPERAND_TYPE_ID, {id}}); |
| 596 | } |
| 597 | |
| 598 | uint32_t result_id = GetContext()->TakeNextId(); |
| 599 | if (result_id == 0) { |
| 600 | return nullptr; |
| 601 | } |
| 602 | std::unique_ptr<Instruction> new_inst( |
| 603 | new Instruction(GetContext(), spv::Op::OpFunctionCall, result_type, |
| 604 | result_id, operands)); |
| 605 | return AddInstruction(std::move(new_inst)); |
| 606 | } |
| 607 | |
| 608 | Instruction* AddVectorShuffle(uint32_t result_type, uint32_t vec1, |
| 609 | uint32_t vec2, |
no test coverage detected