The number of WebGPU features might feel a bit sparse this time, but some major advancements are just around the corner! Future releases will include features like shader compilation speed improvements, and changes to the async model of the implementation using WGPUFuture.
Subgroups (feature in development)
The subgroups feature enables SIMD-level parallelism, allowing threads within a group to communicate and perform collective math operations (for example, calculating the sum of 16 numbers). This provides a highly efficient form of cross-thread data sharing.
Subgroup operations are supported by modern GPU APIs, but naming and implementation details vary. The Chrome team has identified the commonalities and is now working to standardize this feature. Check out the proposal and comment if you have questions.
There's a minimal and unstandardized implementation of subgroups behind the "Experimental Web Platform Features" flag at chrome://flags/#enable-experimental-web-platform-features
so that developers can give it a try and share feedback as real-world benefits have not been proven yet in the context of WebGPU.
When the "chromium-experimental-subgroups"
feature is available in a GPUAdapter
, request a GPUDevice
with this feature to get experimental subgroups support in WGSL and check its minSubgroupSize
and maxSubgroupSize
limits.
You also need to explicitly enable this extension in your WGSL code with enable chromium_experimental_subgroups
. When enabled, you get access to the following additions:
subgroup_invocation_id
: A built-in value for the index of the thread within the subgroup.subgroup_size
: A built-in value for subgroup size access.subgroupBallot(value):
Returns a set of bit fields where the bit corresponding tosubgroup_invocation_id
is 1 ifvalue
is true for that active invocation and 0 otherwise.subgroupBroadcast(value, id)
: Broadcasts thevalue
from the invocation withsubgroup_invocation_id
matchingid
to all invocations within the subgroup. Note:id
must be a compile-time constant.
The following code snippet provides a base to tinker with and discover the potential of subgroups.
const adapter = await navigator.gpu.requestAdapter();
if (!adapter.features.has("chromium-experimental-subgroups")) {
throw new Error("Experimental subgroups support is not available");
}
// Explicitly request experimental subgroups support.
const device = await adapter.requestDevice({
requiredFeatures: ["chromium-experimental-subgroups"],
});
const shaderModule = device.createShaderModule({ code: `
enable chromium_experimental_subgroups;
@compute @workgroup_size(64) fn main(
@builtin(global_invocation_id) global_id : vec3u,
@builtin(subgroup_size) sg_size : u32,
@builtin(subgroup_invocation_id) sg_id : u32) {
// TODO: Use subgroupBallot() and subgroupBroadcast().
}`,
});
Render to slice of 3D texture
You can now render directly to slice(s) of 3D textures within render passes, expanding its capabilities beyond common 2D texture rendering, with the new depthSlice
member in a GPURenderPassColorAttachment
. This addition allows you for example to create voxel-based scenes and effects by rendering directly into 3D texture volumes. See issue dawn:1020.
Dawn updates
Check out the exhaustive list of commits.
What's New in WebGPU
A list of everything that has been covered in the What's New in WebGPU series.
Chrome 129
Chrome 128
- Experimenting with subgroups
- Deprecate setting depth bias for lines and points
- Hide uncaptured error DevTools warning if preventDefault
- WGSL interpolate sampling first and either
- Dawn updates
Chrome 127
- Experimental support for OpenGL ES on Android
- GPUAdapter info attribute
- WebAssembly interop improvements
- Improved command encoder errors
- Dawn updates
Chrome 126
- Increase maxTextureArrayLayers limit
- Buffer upload optimization for Vulkan backend
- Shader compilation time improvements
- Submitted command buffers must be unique
- Dawn updates
Chrome 125
Chrome 124
- Read-only and read-write storage textures
- Service workers and shared workers support
- New adapter information attributes
- Bug fixes
- Dawn updates
Chrome 123
- DP4a built-in functions support in WGSL
- Unrestricted pointer parameters in WGSL
- Syntax sugar for dereferencing composites in WGSL
- Separate read-only state for stencil and depth aspects
- Dawn updates
Chrome 122
- Expand reach with compatibility mode (feature in development)
- Increase maxVertexAttributes limit
- Dawn updates
Chrome 121
- Support WebGPU on Android
- Use DXC instead of FXC for shader compilation on Windows
- Timestamp queries in compute and render passes
- Default entry points to shader modules
- Support display-p3 as GPUExternalTexture color space
- Memory heaps info
- Dawn updates
Chrome 120
- Support for 16-bit floating-point values in WGSL
- Push the limits
- Changes to depth-stencil state
- Adapter information updates
- Timestamp queries quantization
- Spring-cleaning features
Chrome 119
- Filterable 32-bit float textures
- unorm10-10-10-2 vertex format
- rgb10a2uint texture format
- Dawn updates
Chrome 118
- HTMLImageElement and ImageData support in
copyExternalImageToTexture()
- Experimental support for read-write and read-only storage texture
- Dawn updates
Chrome 117
- Unset vertex buffer
- Unset bind group
- Silence errors from async pipeline creation when device is lost
- SPIR-V shader module creation updates
- Improving developer experience
- Caching pipelines with automatically generated layout
- Dawn updates
Chrome 116
- WebCodecs integration
- Lost device returned by GPUAdapter
requestDevice()
- Keep video playback smooth if
importExternalTexture()
is called - Spec conformance
- Improving developer experience
- Dawn updates
Chrome 115
- Supported WGSL language extensions
- Experimental support for Direct3D 11
- Get discrete GPU by default on AC power
- Improving developer experience
- Dawn updates
Chrome 114
- Optimize JavaScript
- getCurrentTexture() on unconfigured canvas throws InvalidStateError
- WGSL updates
- Dawn updates