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
Language feature gate
Check
navigator.gpu.wgslLanguageFeaturesforbuffer_viewbefore emitting the extension.Reinterpret builder
Generate WGSL that turns an opaque
buffer<N>pointer into a typed view withbufferView<T>.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.