subgroup_id

WGSL language feature

Availability now
68%
last 30 days, n = 142
Year over year
unlocks once the dataset spans a year
Explore

Check navigator.gpu?.wgslLanguageFeatures?.has('subgroup_id') before choosing a shader that uses this language feature. It is available automatically when supported; requires subgroup_id; documents the dependency and rejects the shader on unsupported implementations. This language token is not a requiredFeatures entry for requestDevice(); any additional device requirements are described below.

The @builtin(subgroup_id) input identifies the current subgroup within its workgroup, and @builtin(num_subgroups) reports how many subgroups that workgroup contains. These are workgroup-local values, distinct from subgroup_invocation_id, which identifies a lane inside a subgroup.

A reduction can elect one invocation per subgroup to write a partial result into workgroup memory at an index given by subgroup_id. A later workgroup-level step can combine those partial results. Size scratch storage conservatively and synchronize accesses before other invocations consume the results.

The browser’s language token is only part of the requirement: the device must enable subgroups, and the shader must contain enable subgroups;. Do not assume subgroup IDs or lanes have a particular relationship to local_invocation_index. Without this language feature, use an algorithm that does not require explicit subgroup numbering, such as a workgroup-memory reduction.

Availability by month

MonthWith featureEligible reportsAvailability
2026-08 70 106 66.0%
2026-09 26 36 72.2%

By browser (last 30 days)

BrowserAvailabilityn
chrome 97.8% 90
edge 100.0% 8
firefox 0.0% 44

Availability = share of first-party, non-quarantined reports with WebGPU on a hardware (non-fallback) adapter whose browser reports this token in navigator.gpu.wgslLanguageFeatures. This measures language support in the browser, not a GPU hardware capability. Developer-leaning sample. Full methodology.