aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBilly Laws <[email protected]>2022-11-23 21:16:06 +0000
committerRodrigo Locatti <[email protected]>2022-11-23 22:42:49 -0300
commit661499f6ecb85a81e18f160ae7cc2302b958e109 (patch)
tree43cb361896fb5d6d0191555c2e755f0e6061db71
parentda4ffce189fa5d4e0fe3a45df2af38c9853d1a11 (diff)
downloadsirit-661499f6ecb85a81e18f160ae7cc2302b958e109.tar.gz
sirit-661499f6ecb85a81e18f160ae7cc2302b958e109.zip
Add OpGroupNonUniformShuffle subgroup op
-rw-r--r--include/sirit/sirit.h3
-rw-r--r--src/instructions/group.cpp6
2 files changed, 9 insertions, 0 deletions
diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h
index 185568f..af63d69 100644
--- a/include/sirit/sirit.h
+++ b/include/sirit/sirit.h
@@ -1160,6 +1160,9 @@ public:
// the group.
Id OpGroupNonUniformBroadcast(Id result_type, Id scope, Id value, Id id);
+ // Result is the Value of the invocation identified by the id Id.
+ Id OpGroupNonUniformShuffle(Id result_type, Id scope, Id value, Id id);
+
/// Return the value of the invocation identified by the current invocation's id within the
/// group xor'ed with mask.
Id OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask);
diff --git a/src/instructions/group.cpp b/src/instructions/group.cpp
index 71ec8c9..3b6f71a 100644
--- a/src/instructions/group.cpp
+++ b/src/instructions/group.cpp
@@ -42,6 +42,12 @@ Id Module::OpGroupNonUniformBroadcast(Id result_type, Id scope, Id value, Id id)
<< id << EndOp{};
}
+Id Module::OpGroupNonUniformShuffle(Id result_type, Id scope, Id value, Id id) {
+ code->Reserve(6);
+ return *code << OpId{spv::Op::OpGroupNonUniformShuffle, result_type} << scope << value << id
+ << EndOp{};
+}
+
Id Module::OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask) {
code->Reserve(6);
return *code << OpId{spv::Op::OpGroupNonUniformShuffleXor, result_type} << scope << value