demo · v143
GLSL port friction
The use case the feature was added for: porting a GLSL shader where a uniform buffer contains a tight float[] array. Strict WebGPU rounded each element up to 16 bytes (4× the GLSL footprint); v143's relaxed layout matches GLSL.
strict (original WebGPU): every array element padded to 16B
v143 relaxed: matches GLSL / storage-buffer layout
the call
// WGSL — opt-in to the relaxed layout (v143)
enable chromium_experimental_uniform_buffer_standard_layout;
struct U {
weights: array<f32, 8>, // 32 bytes total, like GLSL
};
@group(0) @binding(0) var<uniform> u: U;
why this angle
The other concept lets you type any struct. This one focuses on the most common porting pain — bulk arrays of scalars — and shows the byte savings (75% in this case). That's the friction point GLSL ports were hitting before v143.