demo · v144

Uniform Layout Comparator

Type a struct (one field per line), pick a layout mode, and the page shows the byte layout the GPU would expect. Switch between default WGSL packing and the new std140-compatible mode side by side.

uniform-buffer-standard-layout feature: checking…

default WGSL layout

std140-compatible (Chrome 144 feature)

the API

const device = await adapter.requestDevice({
  requiredFeatures: ['uniform-buffer-standard-layout']
});
// Authoring shaders now mirrors std140 alignment rules — straight port from GLSL.

see also