[perf] WebGPU full-buffer readback copies entire allocation even for a small prefix (WebGPUBuffer.cppm) #133
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found by an adversarially-verified performance audit (confirmed real after a skeptic pass).
Location:
interfaces/Crafter.Graphics-WebGPUBuffer.cppm:117-128Severity: low · Effort: moderate · Category: memory
Problem
EnqueueReadback/PollReadbackalways pass the fullsize; over-provisioned event-queue buffers copy full capacity GPU→staging→wasm per drain.Fix
Add a
byteCountparameter for the live prefix. Constraint: the live event count is GPU-written / unknown at enqueue, so only a fixed header prefix is trivially shrinkable; the variable array needs a two-stage readback.