Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgroup intrinsics #14

Merged
merged 15 commits into from
Sep 23, 2024
Merged

Subgroup intrinsics #14

merged 15 commits into from
Sep 23, 2024

Conversation

Firestar99
Copy link
Contributor

@Firestar99 Firestar99 commented Sep 20, 2024

Requires #12 #13 to be merged first

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? Resolved: Dropped the non_uniform, all are now named subgroup_* like glsl.
  • 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. Resolved: For now I've just left them unsupported.

@LegNeato
Copy link
Collaborator

LegNeato commented Sep 21, 2024

I thought we had a ScalorOrVector trait already but looks like it never landed:

EmbarkStudios/rust-gpu#1030

It is slightly different, perhaps they should be the same?

@Firestar99
Copy link
Contributor Author

I've rebased and made the VectorOrScalar interface match the discussions in EmbarkStudios/rust-gpu#1030

@LegNeato LegNeato merged commit 1103fcc into Rust-GPU:main Sep 23, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants