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

Method AddFunctionCall

source/opt/ir_builder.h:590–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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,

Callers 1

Calls 2

push_backMethod · 0.45
TakeNextIdMethod · 0.45

Tested by

no test coverage detected