Add OpDemoteToHelperInvocation, OpTerminateInvocation

This commit is contained in:
Liam 2022-11-23 17:17:31 -05:00 committed by Rodrigo Locatti
parent 661499f6ec
commit d7ad93a888
3 changed files with 17 additions and 4 deletions

@ -1 +1 @@
Subproject commit a3fdfe81465d57efc97cfd28ac6c8190fb31a6c8
Subproject commit c214f6f2d1a7253bb0e9f195c2dc5b0659dc99ef

View File

@ -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.

View File

@ -92,9 +92,18 @@ void Module::OpKill() {
*code << spv::Op::OpKill << EndOp{};
}
void Module::OpDemoteToHelperInvocationEXT() {
void Module::OpDemoteToHelperInvocation() {
code->Reserve(1);
*code << spv::Op::OpDemoteToHelperInvocationEXT << EndOp{};
*code << spv::Op::OpDemoteToHelperInvocation << EndOp{};
}
void Module::OpDemoteToHelperInvocationEXT() {
OpDemoteToHelperInvocation();
}
void Module::OpTerminateInvocation() {
code->Reserve(1);
*code << spv::Op::OpTerminateInvocation << EndOp{};
}
} // namespace Sirit