From 6c655321e6b04b8648802e296bb5ca11d290ae68 Mon Sep 17 00:00:00 2001 From: swurl Date: Sat, 31 May 2025 02:33:02 -0400 Subject: Move dead submodules in-tree Signed-off-by: swurl --- externals/sirit/src/instructions/function.cpp | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 externals/sirit/src/instructions/function.cpp (limited to 'externals/sirit/src/instructions/function.cpp') diff --git a/externals/sirit/src/instructions/function.cpp b/externals/sirit/src/instructions/function.cpp new file mode 100644 index 0000000000..f84cd7ff53 --- /dev/null +++ b/externals/sirit/src/instructions/function.cpp @@ -0,0 +1,34 @@ +/* This file is part of the sirit project. + * Copyright (c) 2019 sirit + * This software may be used and distributed according to the terms of the + * 3-Clause BSD License + */ + +#include "sirit/sirit.h" + +#include "stream.h" + +namespace Sirit { + +Id Module::OpFunction(Id result_type, spv::FunctionControlMask function_control, Id function_type) { + code->Reserve(5); + return *code << OpId{spv::Op::OpFunction, result_type} << function_control << function_type + << EndOp{}; +} + +void Module::OpFunctionEnd() { + code->Reserve(1); + *code << spv::Op::OpFunctionEnd << EndOp{}; +} + +Id Module::OpFunctionCall(Id result_type, Id function, std::span arguments) { + code->Reserve(4 + arguments.size()); + return *code << OpId{spv::Op::OpFunctionCall, result_type} << function << arguments << EndOp{}; +} + +Id Module::OpFunctionParameter(Id result_type) { + code->Reserve(3); + return *code << OpId{spv::Op::OpFunctionParameter, result_type} << EndOp{}; +} + +} // namespace Sirit -- cgit v1.2.3