From 3641e1de453f2ea5c23830e3b6fb21bdac6fc9da Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sun, 2 Dec 2018 22:57:55 -0300 Subject: [PATCH] Add OpKill --- include/sirit/sirit.h | 3 +++ src/instructions/flow.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index d2b3ad8..f8646b6 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -194,6 +194,9 @@ class Module { /// Return a value from a function. Id OpReturnValue(Id value); + /// Fragment-shader discard. + Id OpKill(); + // Debug /// Assign a name string to a reference. diff --git a/src/instructions/flow.cpp b/src/instructions/flow.cpp index 72a0312..8ff856e 100644 --- a/src/instructions/flow.cpp +++ b/src/instructions/flow.cpp @@ -59,4 +59,9 @@ Id Module::OpReturnValue(Id value) { return AddCode(std::move(op)); } +Id Module::OpKill() { + AddCapability(spv::Capability::Shader); + return AddCode(std::make_unique(spv::Op::OpKill)); +} + } // namespace Sirit