mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-25 19:35:38 +01:00
Add OpFunctionCall
This commit is contained in:
parent
798f8a5866
commit
4043020f45
@ -160,6 +160,10 @@ class Module {
|
|||||||
/// Ends a function.
|
/// Ends a function.
|
||||||
Id OpFunctionEnd();
|
Id OpFunctionEnd();
|
||||||
|
|
||||||
|
/// Call a function.
|
||||||
|
Id OpFunctionCall(Id result_type, Id function,
|
||||||
|
const std::vector<Id>& arguments = {});
|
||||||
|
|
||||||
// Flow
|
// Flow
|
||||||
|
|
||||||
/// Declare a structured loop.
|
/// Declare a structured loop.
|
||||||
|
@ -20,4 +20,13 @@ Id Module::OpFunction(Id result_type, spv::FunctionControlMask function_control,
|
|||||||
|
|
||||||
Id Module::OpFunctionEnd() { return AddCode(spv::Op::OpFunctionEnd); }
|
Id Module::OpFunctionEnd() { return AddCode(spv::Op::OpFunctionEnd); }
|
||||||
|
|
||||||
|
Id Module::OpFunctionCall(Id result_type, Id function,
|
||||||
|
const std::vector<Id>& arguments) {
|
||||||
|
auto op{
|
||||||
|
std::make_unique<Op>(spv::Op::OpFunctionCall, bound++, result_type)};
|
||||||
|
op->Add(function);
|
||||||
|
op->Add(arguments);
|
||||||
|
return AddCode(std::move(op));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Sirit
|
} // namespace Sirit
|
||||||
|
Loading…
Reference in New Issue
Block a user