From 3067893923fa74411ae41c15f5c819c95cc8c295 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 31 Oct 2019 20:23:57 -0300 Subject: [PATCH] Add EmitVertex and EndPrimitive --- include/sirit/sirit.h | 6 ++++++ src/instructions/misc.cpp | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index d889cbc..49312f0 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -358,6 +358,12 @@ public: /// Make an intermediate object whose value is undefined. Id OpUndef(Id result_type); + /// Emits the current values of all output variables to the current output primitive. + Id OpEmitVertex(); + + /// Finish the current primitive and start a new one. No vertex is emitted. + Id OpEndPrimitive(); + // Logical /// Result is true if any component of Vector is true, otherwise result is false. diff --git a/src/instructions/misc.cpp b/src/instructions/misc.cpp index 706de63..c2aa68c 100644 --- a/src/instructions/misc.cpp +++ b/src/instructions/misc.cpp @@ -14,4 +14,12 @@ Id Module::OpUndef(Id result_type) { return AddCode(std::make_unique(spv::Op::OpUndef, bound++, result_type)); } +Id Module::OpEmitVertex() { + return AddCode(std::make_unique(spv::Op::OpEmitVertex)); +} + +Id Module::OpEndPrimitive() { + return AddCode(std::make_unique(spv::Op::OpEndPrimitive)); +} + } // namespace Sirit