diff options
author | ReinUsesLisp <[email protected]> | 2018-12-04 21:30:32 -0300 |
---|---|---|
committer | ReinUsesLisp <[email protected]> | 2018-12-04 21:30:32 -0300 |
commit | e7971b445177d3a4b793def9c1479479371312c2 (patch) | |
tree | 2a0d910457f70d2e5ca2c3ca520294caffcee023 /src/sirit.cpp | |
parent | 3641e1de453f2ea5c23830e3b6fb21bdac6fc9da (diff) | |
download | sirit-e7971b445177d3a4b793def9c1479479371312c2.tar.gz sirit-e7971b445177d3a4b793def9c1479479371312c2.zip |
Add OpExecutionMode
Diffstat (limited to 'src/sirit.cpp')
-rw-r--r-- | src/sirit.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sirit.cpp b/src/sirit.cpp index 89df604..e03fcdf 100644 --- a/src/sirit.cpp +++ b/src/sirit.cpp @@ -49,7 +49,7 @@ std::vector<u8> Module::Assemble() const { memory_model_ref.Write(stream); WriteSet(stream, entry_points); - // TODO write execution mode + WriteSet(stream, execution_modes); WriteSet(stream, debug); WriteSet(stream, annotations); WriteSet(stream, declarations); @@ -80,6 +80,15 @@ void Module::AddEntryPoint(spv::ExecutionModel execution_model, Id entry_point, entry_points.push_back(std::move(op)); } +void Module::AddExecutionMode(Id entry_point, spv::ExecutionMode mode, + const std::vector<Literal>& literals) { + auto op{std::make_unique<Op>(spv::Op::OpExecutionMode)}; + op->Add(entry_point); + op->Add(static_cast<u32>(mode)); + op->Add(literals); + execution_modes.push_back(std::move(op)); +} + Id Module::Emit(Id op) { code.push_back(op); return op; |