aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLiam <[email protected]>2022-11-23 17:17:31 -0500
committerRodrigo Locatti <[email protected]>2022-11-23 22:43:28 -0300
commitd7ad93a88864bda94e282e95028f90b5784e4d20 (patch)
treecaf847f80dc6cfda0a220e6b85f05a71fe4e33de
parent661499f6ecb85a81e18f160ae7cc2302b958e109 (diff)
downloadsirit-d7ad93a88864bda94e282e95028f90b5784e4d20.tar.gz
sirit-d7ad93a88864bda94e282e95028f90b5784e4d20.zip
Add OpDemoteToHelperInvocation, OpTerminateInvocation
m---------externals/SPIRV-Headers0
-rw-r--r--include/sirit/sirit.h6
-rw-r--r--src/instructions/flow.cpp11
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