rust-gpu
rust-gpu copied to clipboard
Subgroup intrinsics
Adds support for subgroup intrinsics, see GL_KHR_shader_subgroup and SPIRV spec 3.49.24. Non-Uniform Instructions.
Note that the glsl extension only exposes spirv's OpGroupNonUniform* instructions, and NOT the OpGroup* instructions which can be found in 3.49.21. Group and Subgroup Instructions. As many OpGroup* instructions are only documented with Reserved., I assume during development they decided against these and switched to the OpGroupNonUniform* instructions.
Open Questions:
- How should the intrinsic functions be named? spirv calls them
OpGroupNonUniform*, glsl calls themsubgroup*. I've decided to name themsubgroup_non_uniform*but I'm wondering if thenon_uniformshould be dropped as they all are non uniform? - Many of the instructions take or return "a scalar or vector of floating-point type, integer type, or Boolean type", for which I've added the
trait VectorOrScalar. But glam's boolean vectors seem to behave weirdly and not work, not even the compiletestarch/anyuses them. So for now I've just left them unsupported.