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 Operations #2557

Closed
wants to merge 17 commits into from
Closed

Subgroup Operations #2557

wants to merge 17 commits into from

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Oct 14, 2023

This continues the work of #2523, which looks like it was abandoned.

Voter operations (booleans):

  • subgroupBallot() -> vec4<u32>
  • subgroupBallot(vote: bool) -> vec4<u32>
  • subgroupAll(vote: bool) -> bool
  • subgroupAny(vote: bool) -> bool

Gather operations (scalars and vectors of f32, i32, u32):

  • subgroupBroadcastFirst(value) -> value
  • subgroupBroadcast(value, index) -> value
  • subgroupShuffle(value, index) -> value
  • subgroupShuffleDown(value, index_offset) -> value
  • subgroupShuffleUp(value, index_offset) -> value
  • subgroupShuffleXor(value, index_mask) -> value

Reduce operations (scalars and vectors of i32, u32):

  • subgroupAnd(value) -> value
  • subgroupOr(value) -> value
  • subgroupXor(value) -> value

Reduce operations (scalars and vectors of f32, i32, u32):

  • subgroupAdd(value) -> value
  • subgroupMul(value) -> value
  • subgroupMin(value) -> value
  • subgroupMax(value) -> value

Scan operations (scalars and vectors of f32, i32, u32):

  • subgroupPrefixExclusiveAdd(value) -> value
  • subgroupPrefixExclusiveMul(value) -> value
  • subgroupPrefixInclusiveAdd(value) -> value
  • subgroupPrefixInclusiveMul(value) -> value

Built-ins values added to the compute stage only:

  • num_subgroups: u32
  • subgroup_id: u32

Built-ins values added to the compute stage and fragment stage:

  • subgroup_size: u32
  • subgroup_invocation_id: u32

  • Implement wgsl-in
  • Implement wgsl-out
  • Implement spv-in
  • Implement spv-out
  • Implement glsl-out
  • Implement hlsl-out
  • Implement msl-out
  • Implement dot-out
  • Snapshots / tests
  • FRAGMENT quad group operations
  • Decide what kinds of subgroupBarrier() make sense
  • Compaction
  • Analyzer
  • Validation

@Lichtso Lichtso requested a review from a team as a code owner October 14, 2023 14:25
@Lichtso Lichtso mentioned this pull request Oct 16, 2023
@exrook
Copy link
Contributor

exrook commented Oct 21, 2023

I've added some more changes on top of your branch to my branch:
diff: https://github.com/Lichtso/naga/compare/subgroup_operations...exrook:naga:wgsl_minimal_subgroup

I think at this point we probably have all the features we'd want for the first iteration of this, modulo any review changes.

@cwfitzgerald
Copy link
Member

Hello, thank you for your PR against Naga!

As part of gfx-rs/wgpu#4231, we have moved development of Naga into the wgpu repository in the Naga subfolder. We have transferred all issues, but we are unable to automatically transfer PRs.

As such, please recreate your PR against the wgpu repository. We apologize for the inconvenience this causes, but will make contributing to both projects more streamlined going forward.

We are leaving PRs open, but once they are transferred, please close the original Naga PR.

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