1
0
Fork 0
mirror of https://git.suyu.dev/suyu/sirit.git synced 2024-12-22 20:22:02 +00:00

Add OpGroupNonUniformShuffle subgroup op

This commit is contained in:
Billy Laws 2022-11-23 21:16:06 +00:00 committed by Rodrigo Locatti
parent da4ffce189
commit 661499f6ec
2 changed files with 9 additions and 0 deletions

View file

@ -1160,6 +1160,9 @@ public:
// the group. // the group.
Id OpGroupNonUniformBroadcast(Id result_type, Id scope, Id value, Id id); 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 /// Return the value of the invocation identified by the current invocation's id within the
/// group xor'ed with mask. /// group xor'ed with mask.
Id OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask); Id OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask);

View file

@ -42,6 +42,12 @@ Id Module::OpGroupNonUniformBroadcast(Id result_type, Id scope, Id value, Id id)
<< id << EndOp{}; << 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) { Id Module::OpGroupNonUniformShuffleXor(Id result_type, Id scope, Id value, Id mask) {
code->Reserve(6); code->Reserve(6);
return *code << OpId{spv::Op::OpGroupNonUniformShuffleXor, result_type} << scope << value return *code << OpId{spv::Op::OpGroupNonUniformShuffleXor, result_type} << scope << value