v133 · graphics

WebGPU: 1-component vertex formats (and unorm8x4-bgra)

Adds additional vertex formats not present in the initial release of WebGPU due to lack of support or old macOS versions (which are no longer supported by any browser). The 1-component vertex formats lets applications request only the necessary data when previously they had to request at least 2x more for 8 and 16-bit data types. The unorm8x4-bgra format mak

concepts

  1. 1-comp + BGRA

    WebGPU gains 1-component vertex formats (float32, sint32, etc.) and unorm8x4-bgra. Cleaner mapping from many real-world vertex layouts.

  2. Tight color buffers

    Vertex-byte-count comparison for the BGRA / 1-byte formats added in 133. Two triangles drawn with the new unorm8x4-bgra attribute.

  3. Format calculator

    Pick a vertex format and a vertex count — get stride, total buffer bytes, and shipping milestone. Eight new 133 formats starred.

  4. Stride optimizer

    Build a vertex layout with any mix of attributes. The optimizer computes old stride (forced 2-component minimum for 8/16-bit) vs new stride (1-component), with a bar chart and total buffer savings for your vertex count.

why it shipped

Adds additional vertex formats not present in the initial release of WebGPU due to lack of support or old macOS versions (which are no longer supported by any browser). The 1-component vertex formats lets applications request only the necessary data when previously they had to request at least 2x more for 8 and 16-bit data types. The unorm8x4-bgra format makes it slightly more convenient to load BGRA-encoded vertex colors while keeping the same shader.

references