← Chrome 153 reference

v153 · enabled by default · webgpu · wgsl

WebGPU: buffer_view feature

Limited availability

  • Chrome · enabled by default 153 (desktop, Android, WebView)
  • Edge · not separately reported (Chromium-based)
  • Firefox · no signal
  • Safari · closed without a position

The parent webgpu web-feature is Baseline limited (queried 2026-07-29); buffer_view itself has no web-features entry and no BCD key of its own (a webstatus.dev query returns zero matches). The milestone=153 listing files this feature as “Enabled by default” (verified 2026-07-29; the listing is authoritative per gendn invariant #2).

A WGSL language feature that lets a shader reinterpret the bytes of a single uniform, storage, or workgroup variable as several different types — dividing one buffer variable into multiple logical variables, or type-punning its contents — through a new opaque buffer type and three new built-in functions (bufferView, bufferArrayView, bufferLength). It adds no JavaScript API surface of its own.

Implementation maturity — read before relying on this

The buffer_view language extension is tagged ["dawn"] in dawn.json — it is a Dawn-track extension, and the wgslLanguageFeatures detection string could in principle change before broader standardization. Vendor positions on the record are “No signal” (Firefox) and “Closed Without a Position” (Safari), so treat this as Chromium-only for now and always feature-detect via navigator.gpu.wgslLanguageFeatures (see detection). The JS-side validation contract for buffer-typed bindings (minBindingSize interaction) is still a spec TODO with no normative text — this page documents the shader-side rules only (see specifications).

at a glance

What it isThe buffer_view WGSL language extension: opaque buffer<N> / buffer types plus built-ins that reinterpret buffer memory as another host-shareable type at a byte offset
Milestone listingChrome 153 — Enabled by default (listing, verified 2026-07-29)
Applies toWGSL shader source compiled through WebGPU (GPUDevice.createShaderModule); no new JS interfaces, methods, or dictionaries — the WebGPU specification contains no buffer_view text (checked 2026-07-29)
Feature detectionnavigator.gpu.wgslLanguageFeatures contains "buffer_view" when supported (see feature detection)
Opt-inNone required — language extensions are automatically available when the implementation supports them; a requires buffer_view; directive documents the dependency and makes unsupported implementations fail with a shader-creation error (see the extension mechanics)
Spec statusMerged into the WGSL specification via gpuweb/gpuweb PR #6291 on 2026-07-14: §6.3 Buffer Types and §17.14 Buffer View Built-in Functions
ImplementationDawn/Tint: WGSL language extension buffer_view in dawn.json (value 9, Dawn-tagged); tracking bug crbug.com/tint/506523198
TestsWebGPU CTS execution + validation suites for all three built-ins (see test coverage); no upstream WPT directory tests
ChromeStatus5094091886034944 — WebGPU: buffer_view feature (blink component Blink>WebGPU, owner alanbaker@google.com)
Source: chromestatus.com/feature/5094091886034944; WGSL §6.3; dawn.json

why it exists

WGSL variables have a single static type: the value stored in a variable cannot be reinterpreted as another type before a memory access occurs. Two practical problems follow, both from the proposal (created 2025-10-20, issue #5338):

For safety and implementation simplicity the type is opaque: it cannot be read, written, or assigned directly — only the new built-in functions can reinterpret its contents (see the ChromeStatus record motivation).

Source: buffer-view proposal — motivation; ChromeStatus API record; webgpu-samples PR #568 (the wireframe scenario the example derives from)

the buffer types

The feature adds two related opaque types (WGSL §6.3). A buffer value denotes memory whose contents can be interpreted as another host-shareable type; buffer values are otherwise opaque and are not constructible — they cannot appear in assignments, and an expression must not evaluate to a buffer type. The only way to interact with them is through the built-in functions (possibly via pointers).

TypeMeaningInstantiation rules
buffer<N>Fixed-size buffer with N bytes of storage. N must be an override-expressionOnly as the store type of a variable in the storage, uniform, or workgroup address spaces; in storage and uniform the size must further be a const-expression
bufferRuntime-sized buffer; its byte size comes from the bound GPUBuffer (see bufferLength)Only as the store type of a variable in the storage address space

Validation of the size parameter N:

Two buffer types are the same type if and only if: both are runtime-sized; or both are fixed-size with a creation-fixed footprint and equal-valued sizes (signed and unsigned sizes compare equal here because sizes are always positive); or both are fixed-size with sizes specified as identifiers resolving to the same pipeline-overridable constant declaration.

Source: WGSL §6.3 Buffer Types (rules quoted and paraphrased from the merged text, fetched 2026-07-29)

the language extension mechanics

buffer_view is a WGSL language extension (WGSL §4.1.2): it is automatically available whenever the implementation supports it — the program does not request it with an enable directive, and there is no chrome://flags entry or Blink runtime flag (the flag is false on the ChromeStatus record; the feature lives in Dawn/Tint, not Blink). The extension index describes it as: “Enables the use of buffer types and the buffer_view built-in functions.”

A requires directive documents the program's use of the extension and turns absence into a hard failure:

requires buffer_view;

@group(0) @binding(0) var<storage> data : buffer;

If the implementation does not support a required extension, shader creation fails with a shader-creation error — so requires buffer_view; both signals non-portability to tooling and guarantees a clean diagnostic instead of a parse error on the buffer type.

Source: WGSL §4.1.2 Language Extensions; WGSL §6.3

feature detection (the JavaScript side)

There is no new JavaScript API: the only JS-observable surface is the pre-existing GPU.wgslLanguageFeatures set-like object, which lists the WGSL language extensions the implementation supports. In Dawn the extension is registered as 'buffer_view' (dawn.json, WGSL language-extension value 9):

const supported = navigator.gpu.wgslLanguageFeatures.has("buffer_view");
if (!supported) {
  // Fall back to multiple bindings or statically-typed buffers.
}

Pair the detection with a requires buffer_view; directive in shaders that use the feature: detection tells you whether to select such a shader; the directive makes an unsupported implementation reject it deterministically.

Source: WebGPU spec — GPU.wgslLanguageFeatures; MDN — GPU.wgslLanguageFeatures (covers the detection API only — zero buffer_view coverage, verified 2026-07-29); dawn.json

the built-in functions

All three functions operate on a pointer to a buffer and are annotated @must_use. Two helper definitions drive their validation (WGSL §17.14):

Common validation contract (details on each member page): AS ∈ {storage, uniform, workgroup}; AM must be a valid access mode for AS; T must be host-shareable, must not be or contain an atomic or buffer type (MSL cannot cast non-atomic to atomic), and must satisfy the address-space layout constraints for AS. Out-of-contract offsets produce an invalid memory reference / invalid pointer at runtime, a shader-creation error for const-expressions, or a pipeline-creation error for override-expressions.

Source: WGSL §17.14 Buffer View Built-in Functions; proposal — function contracts

buffer pointers as function parameters

Buffer values cannot be passed to functions (they are not constructible and no expression may evaluate to one), but buffer pointers can. Because the parameter address spaces involved exceed the default pointer-parameter rules, this requires the unrestricted_pointer_parameters extension as well as buffer_view. Two feasible automatic conversions then relax type matching (WGSL conversion-rank table):

Argument (source)Parameter (destination)RankEffect
ptr<AS, buffer<N1>, AM>ptr<AS, buffer<N2>, AM> (both const-expressions)1 if N2 < N1, infinity otherwiseA fixed-size buffer pointer argument converts to a smaller fixed-size pointer parameter
ptr<AS, buffer<N>, AM>ptr<AS, buffer, AM>1A fixed-size buffer pointer argument converts to a runtime-sized buffer pointer parameter

No other automatic conversions apply. Buffer sizes cannot be grown through a call: the buffer size any built-in sees is the minimum of the originating variable's size and the smallest fixed-size formal parameter on the call stack — implementations use interprocedural analysis for both validation and bufferLength. When unrestricted_pointer_parameters is not supported, the root identifier of a built-in's argument must be the originating variable.

requires buffer_view;
requires unrestricted_pointer_parameters;

@group(0) @binding(0) var<storage> big : buffer<2048>;

// Accepts any storage buffer pointer: buffer<2048> converts to buffer (rank 1).
fn helper(p : ptr<storage, buffer>) -> u32 {
  return bufferLength(p);  // sees the minimum size on the call stack
}

fn caller() -> u32 {
  return helper(&big);
}
Source: WGSL — feasible automatic conversions; WGSL §17.14 introductory rules

examples

Sub-dividing one storage binding into two logical arrays (derived from the proposal's wireframe scenario — buffer layout | indices size | indices | vertices |, tightly packed in a single GPUBuffer):

requires buffer_view;

@group(0) @binding(0) var<storage> indices_and_vertices : buffer;

fn foo() {
  let indices_size = *bufferView<u32>(&indices_and_vertices, 0);

  let indices_ptr = bufferArrayView<array<u32>>(&indices_and_vertices, 4, indices_size);
  let vertices_ptr = bufferView<array<f32>>(&indices_and_vertices, indices_size + 4);

  // Use indices_ptr and vertices_ptr like separate indices/vertices variables.
}

The matching JavaScript side binds one tightly-packed buffer — no 256-byte alignment gap between the two regions (contrast the two-binding layout that minStorageBufferOffsetAlignment forces without this feature):

const total = 4 + indices_size + vertices_size;
const buffer = device.createBuffer({ size: total, usage: GPUBufferUsage.STORAGE });

const bg = device.createBindGroup({
  layout: pipeline.getBindGroupLayout(0),
  entries: [{ binding: 0, resource: buffer }],
});

The Chrome Platform Showcase has no route for this feature yet (both slug spellings 404, checked 2026-07-29); the upstream sample is the open webgpu-samples PR #568 (“Add a buffer_view variant option to wireframe sample”, open at fetch time).

Source: proposal — motivating example; webgpu-samples PR #568

error and edge behavior

SituationBehavior
Implementation lacks the extension and shader uses buffer typesParse/validation failure; with requires buffer_view; it is a defined shader-creation error
N ≤ 0, or N not divisible by 4 (by 2 when f16 is enabled)Shader-creation error if N is a const-expression; pipeline-creation error otherwise
bufferView/bufferArrayView with T atomic, containing an atomic, or a buffer typeValidation error (precondition failure) — reinterpretation is single-shot and non-atomic only
Negative offset/size (i32 overloads)Shader-creation error (const-expression < 0); pipeline-creation error (override-expression < 0); otherwise an indeterminate value may be used
Out-of-range reinterpretation (MinTypeSize(T) + offset > bufferLength(p), or offset + size > bufferLength(p), or MinTypeSize(T) > size)An invalid memory reference / invalid pointer is returned at runtime; statically-known cases are shader-creation or pipeline-creation errors
Misaligned offset (offset % RequiredAlignOf(T, AS) != 0)Shader-creation error (const-expression) / pipeline-creation error (override-expression); otherwise the implementation rounds down to offset & ~(RequiredAlignOf(T, AS) - 1)
Structuring a declaration of buffer type outside storage/uniform/workgroup, or assigning a buffer valueValidation error — the type is opaque and not constructible
Source: WGSL §6.3; WGSL §17.14

test coverage

The WebGPU Conformance Test Suite (CTS) covers all three built-ins with execution and validation suites:

There are no upstream WPT webgpu directory tests for this feature (the directory holds only metadata files, checked 2026-07-29); the ChromeStatus record marks wpt: true — the CTS is the executable conformance story for WebGPU. Per-run pass counts are not inventoried here.

Source: gpuweb/cts builtin test directory (fetched 2026-07-29); WPT webgpu directory

browser compatibility

Interim table. BCD has no buffer_view key (the feature is a WGSL extension, not JS API surface; BCD api/GPU.json checked 2026-07-29) and webstatus.dev has no entry, so rows are compiled from the linked primary sources. The detection mechanism (GPU.wgslLanguageFeatures) does have BCD data, shown in the second table.

Browserbuffer_view supportEvidence
ChromeEnabled by default 153 (desktop, Android, WebView)milestone=153 listing; record (desktop/android/webview 153, flag: false)
EdgeNot separately reportedChromium-based; no separate position on the record
FirefoxNo signalmozilla/standards-positions #1205 (per the record's views link)
SafariClosed without a positionWebKit/standards-positions #294 (per the record's views link)

Detection API support (BCD api.GPU.wgslLanguageFeatures):

BrowserGPU.wgslLanguageFeatures
Chrome144 (full; ChromeOS, macOS, Windows, Linux Intel Gen12+); 115–143 partial (ChromeOS, macOS, Windows)
Chrome Android121
EdgeMirrors Chrome
Firefox141 (partial — all contexts except service workers, bug 1942431)
Safari26
Source: chromestatus.com/feature/5094091886034944; BCD api/GPU.json (fetched 2026-07-29)

security and privacy

Source: WGSL §6.3; WGSL §17.14; proposal — design constraints

specifications

Documents fetched 2026-07-29; each row links the artifact directly.

DocumentStatus
WGSL — §6.3 Buffer Types and §17.14 Buffer View Built-in FunctionsEditor's Draft text merged via PR #6291 (merged 2026-07-14)
buffer-view proposalStatus “Merged”; created 2025-10-20; tracks issue #5338 (closed)
WebGPU API specificationUnchanged by this feature (no buffer_view content, checked 2026-07-29) — detection rides the existing wgslLanguageFeatures member

see also