diff options
author | ReinUsesLisp <[email protected]> | 2018-12-02 22:57:55 -0300 |
---|---|---|
committer | ReinUsesLisp <[email protected]> | 2018-12-02 22:57:55 -0300 |
commit | 3641e1de453f2ea5c23830e3b6fb21bdac6fc9da (patch) | |
tree | a64fd6949eea10e9f88ed8ac4a8e294525a2dc74 | |
parent | 93d42e62da8913267ba0fa724553078869aebf7d (diff) | |
download | sirit-3641e1de453f2ea5c23830e3b6fb21bdac6fc9da.tar.gz sirit-3641e1de453f2ea5c23830e3b6fb21bdac6fc9da.zip |
Add OpKill
-rw-r--r-- | include/sirit/sirit.h | 3 | ||||
-rw-r--r-- | src/instructions/flow.cpp | 5 |
2 files changed, 8 insertions, 0 deletions
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<Op>(spv::Op::OpKill)); +} + } // namespace Sirit |