← Back to release summary

WebGPU: Uniform buffer standard layout

Category
Graphics
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Functionality added to the WebGPU spec after its first shipment in a browser. Uniform buffers declared in WGSL shaders are no longer required to have 16-byte alignment on array elements, or to pad nested structure offsets to a multiple of 16 bytes.

Motivation

This feature simplifies the use of uniform buffers in WGSL shaders by unifying their constraints with those of storage buffers. Without this, developers are required to align all array elements to 16 bytes and pad nested structures to achieve a 16-byte offset.

Standards & signals

Explainers: https://github.com/gpuweb/gpuweb/issues/4973

View on chromestatus.com