shader: Implement VOTE

This commit is contained in:
ameerj 2021-03-23 20:27:17 -04:00
parent d40faa1db0
commit 3d07cef009
18 changed files with 182 additions and 6 deletions

View file

@ -1444,4 +1444,20 @@ F32 IREmitter::ImageSampleDrefExplicitLod(const Value& handle, const Value& coor
return Inst<F32>(op, Flags{info}, handle, coords, dref, lod_lc, offset);
}
U1 IREmitter::VoteAll(const U1& value) {
return Inst<U1>(Opcode::VoteAll, value);
}
U1 IREmitter::VoteAny(const U1& value) {
return Inst<U1>(Opcode::VoteAny, value);
}
U1 IREmitter::VoteEqual(const U1& value) {
return Inst<U1>(Opcode::VoteEqual, value);
}
U32 IREmitter::SubgroupBallot(const U1& value) {
return Inst<U32>(Opcode::SubgroupBallot, value);
}
} // namespace Shader::IR

View file

@ -234,6 +234,11 @@ public:
const Value& offset, const F32& lod_clamp,
TextureInstInfo info);
[[nodiscard]] U1 VoteAll(const U1& value);
[[nodiscard]] U1 VoteAny(const U1& value);
[[nodiscard]] U1 VoteEqual(const U1& value);
[[nodiscard]] U32 SubgroupBallot(const U1& value);
private:
IR::Block::iterator insertion_point;

View file

@ -355,3 +355,9 @@ OPCODE(ImageSampleImplicitLod, F32x4, U32,
OPCODE(ImageSampleExplicitLod, F32x4, U32, Opaque, Opaque, Opaque, )
OPCODE(ImageSampleDrefImplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
OPCODE(ImageSampleDrefExplicitLod, F32, U32, Opaque, F32, Opaque, Opaque, )
// Vote operations
OPCODE(VoteAll, U1, U1, )
OPCODE(VoteAny, U1, U1, )
OPCODE(VoteEqual, U1, U1, )
OPCODE(SubgroupBallot, U32, U1, )