rust-gpu icon indicating copy to clipboard operation
rust-gpu copied to clipboard

Subgroup intrinsics

Open Firestar99 opened this issue 1 year ago • 0 comments

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 them subgroup*. I've decided to name them subgroup_non_uniform* but I'm wondering if the non_uniform should 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 compiletest arch/any uses them. So for now I've just left them unsupported.

Firestar99 avatar Jun 11 '24 12:06 Firestar99