Web shell: don't self-clamp maxStorageBuffersPerShaderStage to the WebGPU default - #10
Open
octopusburrow wants to merge 1 commit into
Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The WebGPU shell's wantedLimits hardcoded
maxStorageBuffersPerShaderStageat 8 —exactly the WebGPU default — so
Math.min(wanted, adapter)could never grant more evenon 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.