Skip to content

Add support for WGSL subgroup_uniformity and subgroup_id language extensions#8426

Merged
mvaligursky merged 2 commits into
mainfrom
mv-webgpu-subgroup-extentions
Jan 30, 2026
Merged

Add support for WGSL subgroup_uniformity and subgroup_id language extensions#8426
mvaligursky merged 2 commits into
mainfrom
mv-webgpu-subgroup-extentions

Conversation

@mvaligursky

@mvaligursky mvaligursky commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add detection for subgroup_uniformity WGSL language extension (Chrome 145+), which allows subgroup functionality to be considered uniform in more cases during shader compilation
  • Add detection for subgroup_id WGSL language extension (Chrome 144+), which provides access to subgroup_id and num_subgroups built-in values in workgroups

Details

Both features are detected via navigator.gpu.wgslLanguageFeatures and exposed as read-only properties on GraphicsDevice:

  • supportsSubgroupUniformity - for the subgroup_uniformity extension
  • supportsSubgroupId - for the subgroup_id extension

References

* True if the device supports the WGSL subgroup_uniformity extension, which allows
* subgroup functionality to be considered uniform in more cases during shader compilation.
* When a shader uses this feature, use an `enable` directive at the top of the WGSL shader:
* ```javascript

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know support for wgsl is a bit flaky in the toolchain, but I would still specify it here since it's correct and makes it clear to readers of the source that this is WGSL code (even if the TypeDoc manual fails to color code it properly).

@mvaligursky mvaligursky merged commit 13c9d98 into main Jan 30, 2026
7 checks passed
@mvaligursky mvaligursky deleted the mv-webgpu-subgroup-extentions branch January 30, 2026 14:47
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.

2 participants