perf(ui): per-shelf dirty spans for tight font-atlas uploads (#129) #147
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics!147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-129"
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
FontAtlas::Updateaccumulated all glyph dirt into a single union bounding box. When new glyphs land on different shelves the same frame, that union becomes a tall box spanning the untouched rows between the shelves, so the upload copies mostly-unchanged texels. Warmup-only (glyphs are write-once; steady state bails on!dirty).Fix
Track a dirty span per shelf (
Shelf::dirty) and issue one tightUpdateRegion/wgpuWriteAtlasRegioncopy per armed span. A shelf packs glyphs left-to-right at a fixed top, so each span is naturally a contiguous X run capped by the shelf height — no wasted rows between shelves.ShelfPlacenow reports the placed shelf index so the caller marks the right span.Initializekeeps using the existingdirtyRectspan.dirtyis now the OR of every span;Updateclears them all together.DirtyRect,MarkDirty, and the publicdirtyflag keep their existing semantics, so theFontAtlasDirtyRectmath test is unchanged.Testing
crafter-build test— 23 passed (incl.FontAtlasDirtyRect,ShapeTextCache,ImageStagingRelease).Screenshots
Resolves #129