diff options
m--------- | externals/SPIRV-Headers | 0 | ||||
-rw-r--r-- | include/sirit/sirit.h | 6 | ||||
-rw-r--r-- | src/instructions/flow.cpp | 11 |
3 files changed, 15 insertions, 2 deletions
diff --git a/externals/SPIRV-Headers b/externals/SPIRV-Headers -Subproject a3fdfe81465d57efc97cfd28ac6c8190fb31a6c +Subproject c214f6f2d1a7253bb0e9f195c2dc5b0659dc99e diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index af63d69..6ced1a8 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -309,12 +309,16 @@ public: /// Return a value from a function. Id OpReturnValue(Id value); - /// Fragment-shader discard. + /// Deprecated fragment-shader discard. void OpKill(); /// Demote fragment shader invocation to a helper invocation + void OpDemoteToHelperInvocation(); void OpDemoteToHelperInvocationEXT(); + /// Fragment-shader discard. + void OpTerminateInvocation(); + // Debug /// Assign a name string to a reference. diff --git a/src/instructions/flow.cpp b/src/instructions/flow.cpp index e462dcb..5f6b693 100644 --- a/src/instructions/flow.cpp +++ b/src/instructions/flow.cpp @@ -92,9 +92,18 @@ void Module::OpKill() { *code << spv::Op::OpKill << EndOp{}; } +void Module::OpDemoteToHelperInvocation() { + code->Reserve(1); + *code << spv::Op::OpDemoteToHelperInvocation << EndOp{}; +} + void Module::OpDemoteToHelperInvocationEXT() { + OpDemoteToHelperInvocation(); +} + +void Module::OpTerminateInvocation() { code->Reserve(1); - *code << spv::Op::OpDemoteToHelperInvocationEXT << EndOp{}; + *code << spv::Op::OpTerminateInvocation << EndOp{}; } } // namespace Sirit |