v152 · graphics · webgpu

WebGPU: buffer_view feature

The WGSL language feature buffer_view adds an opaque host-shareable buffer<N> type plus bufferView, bufferArrayView, and bufferLength built-ins for controlled reinterpretation of uniform, storage, and workgroup variables.

concepts

  1. Language feature gate

    Check navigator.gpu.wgslLanguageFeatures for buffer_view before emitting the extension.

  2. Reinterpret builder

    Generate WGSL that turns an opaque buffer<N> pointer into a typed view with bufferView<T>.

  3. Offset and size validator

    Validate alignment and minimum-size rules before a shader or pipeline-creation error.

why it shipped

Advanced compute shaders sometimes need to reinterpret one large buffer as several logical typed regions. The proposal keeps this capability behind a WGSL extension and restricts operations to built-ins so implementations can preserve layout and bounds checks.

references