render: drop per-frame blits on unified-memory GPUs #396
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!396
Loading…
Reference in a new issue
No description provided.
Delete branch "render/uma-direct-write"
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?
On Apple Silicon the felis client's physical footprint sat at 424 MB for a focused window with a blinking cursor, and every throughput benchmark peaked at 430–460 MB (#382). Almost none of it is felis's own:
MTLDevice.currentAllocatedSizestays near 21 MB. The rest is Apple's GPU driver charging per-encoder-type working sets to the process, about 240 MB once a render encoder runs and about 160 MB more once any blit or compute encoder does. Each is released about a second after that encoder type last ran. A bare Metal program with no wgpu reproduces both numbers.felis woke the blit set on every repaint (
Queue::write_bufferfor instance data and uniforms) and on every new glyph or image (Queue::write_texture, plus wgpu's buffer-copy zero-init of the glyph atlas). On a unified-memory adapter (integrated GPU withMAPPABLE_PRIMARY_BUFFERS) this branch removes all of those blits:MAP_WRITEbuffers written in place. The slot being reused was last read three submissions back, so re-mapping it waits on that submission, not on the newest.RENDER_ATTACHMENT, which also moves wgpu's lazy zero-init to a render-pass clear.Measured on an M4 (release, same config, 0.25 s sampling like the benchmark harness):
catwall-clockKept honest:
docs/reference/benchmarks.mdstill shows the pre-change felis figures; republishing them is a separate run.Verified:
just fmt-check lint check-portable prose-check skill-check docs-links denypass, and felis-render-wgpu passes 274/274 tests.