demo · v133
Single-channel buffers — smaller, faster, BGRA-correct
Pre-133 you had to pad a 1-byte vertex attribute up to 4 bytes (uint8x4 → ignore three). And BGRA-ordered colours had to be swizzled on the CPU. This release adds uint8, sint8, uint16, sint16, unorm8, snorm8, float16 plus unorm8x4-bgra — matching D3D/Metal/Vulkan, ending the swizzles, shrinking buffers up to 4×.
| format | bytes | typical use |
|---|---|---|
uint8 | 1 | palette index, glyph id |
unorm8 | 1 | alpha-only mask |
unorm8x2 | 2 | UV at low precision |
float16x2 | 4 | half-precision normals |
unorm8x4-bgra | 4 | BGRA texture / colour (no swizzle) |
why the BGRA variant matters
DirectX swap-chains and many Windows/Linux GPUs natively store colour in BGRA order. WebGPU had only RGBA-ordered vertex formats, so apps re-ordered every vertex on the CPU before uploading. The new unorm8x4-bgra format lets the buffer stay in its native layout, the shader reads in BGRA order, and the swizzle disappears. Combined with the 1- and 2-component byte formats, glyph and particle systems get 2–4× smaller vertex buffers and shorter upload times.