#9389·engine

feat(graphics): adopt WGSL buffer_view once every WebGPU browser ships it

Author: mvaligurskyCreated Sep 15, 2026Updated Sep 15, 2026
Labelsarea: graphics

Background

The buffer_view WGSL language extension lets a uniform, storage or workgroup variable be declared with an opaque buffer store type and reinterpreted as typed data at a byte offset, with bounds checking, through three built-ins:

  • bufferView<T> - a pointer to a T at a byte offset
  • bufferArrayView<T> - a pointer to a bounded, runtime-sized array<T> at a byte offset
  • bufferLength - the byte size of the buffer

This gives safe type punning and lets one buffer be partitioned into logical sections, e.g. an index count, an index array and a vertex array in a single storage buffer (the Chrome post links a wireframe sample doing exactly that).

It is a requires extension. The directive only documents the dependency and makes shader creation fail early where the extension is missing; it does not gate the feature.

Status

  • Shipped in Chrome 153 (What's New in WebGPU 153-154). Chrome Canary 155 lists it in navigator.gpu.wgslLanguageFeatures; Chrome 152 stable does not.
  • Not shipped in Firefox or Safari as far as we know.

Plan

Do not add engine support yet - no supports* flag, no CAPS_* define, no injected requires line, and no use in engine chunks - until every WebGPU browser ships it, so no use site ever needs a fallback path.

Candidates once it is universally available:

  1. Gsplat and clustered-lighting chunks that reinterpret packed data (roughly 30 bitcast<> sites, plus the array<u32> storage buffers in the gsplat compute chunks) could read typed views from a single buffer instead.
  2. Single-buffer partitioning for mixed data, e.g. indirect args plus counters, or index plus vertex data for vertex pulling.
  3. Check that the storage-buffer regex in WebgpuShaderProcessorWGSL accepts the opaque buffer store type, and confirm BindGroupFormat needs no change (the binding remains a plain storage buffer).

Triggers to revisit

  • Firefox and Safari stable report navigator.gpu.wgslLanguageFeatures.has('buffer_view') === true.

References