Minimal reproduction of the WebGPU validation error:
Too many bindings of type StorageBuffers in Stage ShaderStages(COMPUTE), limit is 8,
count was 9. Check the limit `max_storage_buffers_per_shader_stage` passed to
`Adapter::request_device`
index.html is a single, self-contained page. It:
- Requests a default WebGPU adapter and device (no raised limits, so the default
maxStorageBuffersPerShaderStageof 8 applies). - Generates a compute shader that declares 9
var<storage, read_write>buffers. - Builds the bind group layout / pipeline / bind group with 9 storage buffers and submits a dispatch.
Because 9 > 8, the browser raises the validation error above. It surfaces both as an "Uncaptured WebGPU error" in the console and via the captured error scope shown on the page.
WebGPU requires a secure context, so serve over localhost (a file:// URL will not
work):
cd webgpu-storage-buffer-repro
python3 -m http.server 8000Then open http://localhost:8000/ in Firefox (WebGPU must be enabled — see below) and open the browser console.
- Firefox Nightly ships WebGPU enabled. In stable/other builds, set
dom.webgpu.enabled = trueinabout:config. - Confirm
navigator.gpuis defined; the page reports if it is not.
Edit BUFFER_COUNT in index.html:
9(default) — triggers the error.8— within the default limit; no error (sanity check).