v144 · graphics

WebGPU: `subgroup_id` feature

Functionality added to the WebGPU spec after its first shipment in a browser.

concepts

  1. subgroup_id

    Adds subgroup_id as a WGSL built-in — lets compute shaders coordinate within subgroups (warp/wavefront) without ambient knowledge of the device.

  2. Parallel Reduction

    A WGSL parallel-reduction shader using subgroupAdd — the bread-and-butter primitive that subgroup_invocation_id and ballot enable.

  3. Device Probe

    Real adapter info from your GPU: vendor, architecture, subgroup size limits, supported subgroup features. Includes a visualisation of subgroup_invocation_id across a 64-thread workgroup.

  4. Subgroup Ballot Visualizer

    Click invocations to toggle their vote and see subgroupBallot() produce a live bitmask, with the elected invocation (subgroupElect()) highlighted. Adjust subgroup size between 8, 16, 32, and 64 lanes.

why it shipped

The `subgroup_id` and `num_subgroups` built-in values are now available when the subgroups extension is enabled.

references