demo · v143
UBO Layout
Type a struct definition. The calculator shows the byte layout with WebGPU's strict UBO rules vs the relaxed v143 standard layout, side by side. The bottom probe asks your browser whether the feature is exposed.
WebGPU support
checking…
struct (one field per line: type name)
strict UBO layout (default)
uniform-buffer-standard-layout (v143)
Strict UBO inflates array element strides and nested struct alignment to 16 bytes. The standard layout uses scalar alignment, matching std430 / GLSL std140 conventions and making GLSL ports drop in.
the call
const device = await adapter.requestDevice({
requiredFeatures: ["uniform-buffer-standard-layout"]
});
// shader: enable uniform_buffer_standard_layout;
see also
- WebGPU uniform-buffer-standard-layout — feature index
- ChromeStatus entry
- WGSL spec