fix(webgpu): request adapter's storage-buffer limit, not hardcoded 16 #9
No reviewers
Labels
No labels
claude:done
claude:in-progress
claude:ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics!9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-8"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
additional/dom-webgpu.jshardcoded the device'smaxStorageBuffersPerShaderStagerequest to 16, even when the adapter supports far more (64 in our test env). The wavefront SHADE kernel already binds ~16 storage buffers (group(1) RT/work buffers +wfPayload, group(2)wfIndirect) before any user binding, so any RT pipeline declaring 2+ user storage buffers at@group(3)overflowed the limit and the pipeline failed to build:This contradicted
WAVEFRONT-DESIGN.md's claim that Phase 7 binding packing was unnecessary because the device has 64 storage buffers/stage — the adapter reported 64, but the device was clamped to 16.Fix
Request the adapter's reported
maxStorageBuffersPerShaderStage/maxStorageBuffersInPipelineLayoutinstead of a fixed 16.clampalready mins against the adapter cap, so baseline-only devices still get a valid request; the|| 16fallback plus the existingtypeof cap === "number"guard handle limit names a browser doesn't expose (Firefox returnsnullformaxStorageBuffersInPipelineLayout, so it's simply not requested). Also updated the design doc to note Phase 7's skip now depends on this.Verification
No automated tests exist for the JS bridge (
crafter-build test→ "No tests matched"), so verified directly in Firefox with real WebGPU:maxStorageBuffersPerShaderStage: 64; the device now requests 64 (was 16).rtPipelines=1, no validation errors, normal per-pass timings).Screenshots
Resolves #8