feat(metal4): add GPU-ready model buffer cache via Metal IO #414
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!414
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/414/head"
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?
@maple-quartz18 on GitHub · 2026-11-26 21:38 UTC · original
maple-quartz18:p1-model-buffer-cache→master· +254 −2 · 2 files · 1 commits · merged 2026-11-26 22:06 UTCWhat
Adds a versioned GPU-ready model buffer cache (
SXMTLIO2), mirroring the existing texture cache design:load_bufferDMAs cached vertex/index bytes straight into PRIVATE buffers (staging=None), withcommit().wait()so the buffers are ready before the first draw.Why
Model upload currently re-uploads the same vertex/index data from CPU staging on every launch. Caching the GPU-ready bytes lets Metal IO load them directly, avoiding the CPU staging copy.
build_vertex_index_bytes()from the already-merged P0 is the single source of truth for the byte layout, so cached payloads are byte-identical to what runtime upload expects.Safety
configure_renderer()next to the texture cache, sharing the same work root.Verification
[36..40]= identity CRC,[28..32]vertex CRC,[32..36]index CRC.load_buffer/new_io_file_handlesignatures.load_bufferon real macOS GPU needs a hardware smoke test (binding layer does not restrict storageMode).@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-26 21:39 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.