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