Skip to content

Web shell: don't self-clamp maxStorageBuffersPerShaderStage to the WebGPU default - #10

Open
octopusburrow wants to merge 1 commit into
dwalter:webgpu-4.6.2from
octopusburrow:pr8-storage-buffer-limit
Open

Web shell: don't self-clamp maxStorageBuffersPerShaderStage to the WebGPU default#10
octopusburrow wants to merge 1 commit into
dwalter:webgpu-4.6.2from
octopusburrow:pr8-storage-buffer-limit

Conversation

@octopusburrow

Copy link
Copy Markdown

The WebGPU shell's wantedLimits hardcoded maxStorageBuffersPerShaderStage at 8 —
exactly the WebGPU default — so Math.min(wanted, adapter) could never grant more even
on adapters offering 16+. The Mobile rendering method (Godot's default renderer for web
exports) has a scene shader that binds 10 storage buffers in
the vertex stage, so every lit 3D scene failed CreatePipelineLayout with a
GPUValidationError naming this limit, and rendered black. (Unshaded scenes stay under
the limit, which is why the samples that render are the unshaded ones.)

Request the adapter's own maximum for this limit instead, matching the policy the
engine.js device path already uses. Measured on Windows/Dawn (adapter max 16): the
pipeline-layout errors disappear and all Mobile scene pipelines create cleanly.

Honest scope note: this does not yet produce lit pixels. With the limit fixed and zero
remaining validation errors, scenes with lights and materials still render black on the
Mobile renderer; only unshaded scenes produce output (verified against an unshaded
control through the same harness, under both directional and pure-ambient lighting).
The limit clamp was the first blocker; a second, silent one remains, and we're
investigating. This fix stands on its own: the validation errors are real, and any
lit-path fix needs it in place first.

…bGPU default

The WebGPU shell's wantedLimits hardcoded maxStorageBuffersPerShaderStage
at 8 — exactly the WebGPU default — so Math.min(wanted, adapter) could
never grant more even on adapters offering 16+. The Mobile renderer's
scene shader binds 10 storage buffers in the vertex stage, so every lit
3D scene failed CreatePipelineLayout with a GPUValidationError naming
this limit, and rendered black. (Unshaded scenes stay under the limit,
which is why the samples that render are the unshaded ones.)

Request the adapter's own maximum for this limit instead, matching the
policy the engine.js device path already uses. Measured on Windows/Dawn
(adapter max 16): the pipeline-layout errors disappear and all Mobile
scene pipelines create cleanly.

Note this does not yet produce lit pixels: with the limit fixed and zero
remaining validation errors, the Mobile lit path still renders black
(verified against an unshaded control at luma 35 through the same
harness, under both directional and pure-ambient lighting). The limit
clamp was the first, self-inflicted blocker; a second, silent one
remains and is now cleanly reproducible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant