Skip to content

Add WebGPU subgroup operations support#8528

Merged
mvaligursky merged 1 commit intomainfrom
mv-subgroup-support
Mar 13, 2026
Merged

Add WebGPU subgroup operations support#8528
mvaligursky merged 1 commit intomainfrom
mv-subgroup-support

Conversation

@mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Mar 13, 2026

Adds support for WebGPU subgroup operations as an optional device capability.

Changes:

  • Request the subgroups device feature when the adapter supports it
  • Add supportsSubgroups property to GraphicsDevice for runtime capability checking
  • Add CAPS_SUBGROUPS and CAPS_SUBGROUP_ID shader defines for conditional compilation
  • Auto-inject enable subgroups; and requires subgroup_id; directives into WGSL shaders when available
  • Update JSDoc for existing supportsSubgroupUniformity and supportsSubgroupId properties

API Changes:

  • New GraphicsDevice.supportsSubgroups (boolean, readonly) — true when the device supports subgroup builtins (subgroupBroadcast, subgroupAll, subgroupAny, subgroupAdd, subgroupShuffle, etc.)
  • New CAPS_SUBGROUPS shader define — available via #ifdef CAPS_SUBGROUPS
  • New CAPS_SUBGROUP_ID shader define — available via #ifdef CAPS_SUBGROUP_ID

Request the `subgroups` device feature, add `supportsSubgroups` property,
auto-inject `enable subgroups;` and `requires subgroup_id;` into WGSL shaders,
and expose `CAPS_SUBGROUPS` / `CAPS_SUBGROUP_ID` shader defines.

Made-with: Cursor
@mvaligursky mvaligursky self-assigned this Mar 13, 2026
@mvaligursky mvaligursky merged commit 10bf620 into main Mar 13, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-subgroup-support branch March 13, 2026 12:32
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.

1 participant