refactor(metal4): extract build_vertex_index_bytes for shared use #398
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!398
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/398/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 19:09 UTC · original
maple-quartz18:p0-extract-build-vertex-index-bytes→master· +41 −26 · 1 files · 2 commits · merged 2026-11-26 20:22 UTCWhat
Pure refactor, no behavior change. Move the vertex/index/mesh assembly out of
upload_shared()into a new pure public functionbuild_vertex_index_bytes().Why
This is the prerequisite for a GPU-ready model buffer cache. Runtime upload and offline baking need to produce identical vertex/index bytes. With a single shared assembler, cache payloads are byte-identical by construction instead of by convention.
Verification
material_countis exactly equivalent to the previousmaterials.len()(1 whenmodel.materialsis empty, otherwise its length).bail!,Context,Vec3,bytemuck) are already file-level imports; the new function compiles as-is.vertex4(),GpuMesh4fields and order as before.@copilot-pull-request-reviewer[bot] on GitHub · 2026-11-26 19:09 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.