refactor(metal4): extract egui painter crate #506
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!506
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-506"
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-27 20:54 UTC · original
maple-quartz18:feature/extract-egui-mtl4→master· +712 −26 · 10 files · 2 commits · merged 2026-11-28 12:28 UTCSummary
master(SixNG0.14.0).crates/egui-mtl4.path = "../egui-mtl4"fromsixng-gui.Painter::set_linear_texture_ids.0aa2a1f694adf1a7e3ba877cc799e114d639df16.The Metal IO zlib model-cache work was removed from this PR and will be submitted separately.
The separate
maple-quartz18/egui-mtl4repository remains a publishing/synchronization mirror only.Validation
cargo check --workspacepython3 scripts/check_metal_rust_pin.pycargo test --locked -p egui-mtl4(3 passed)cargo build --locked -p sixng-gui --features metal4-poc --example metal4_windowgit diff --check@holdmysocks on GitHub · 2026-11-27 21:17 UTC · original
Thanks for this. The extraction itself looks good: the painter code matches what we had, and
set_linear_texture_idsis a nice way to drop the SixNG-specific check.One thing before we merge: the PR description and the
THIRD_PARTY_NOTICES.mdtext say the painter becomes a workspace package undercrates/egui-mtl4, but the diff instead removesmetal4_egui.rsand pulls the crate from a separate repository by git revision. We'd like to keep it inside this repo, as the description says:crates/egui-mtl4(its ownCargo.toml,src/lib.rs, README) and list it in the workspace members;sixng-guidepend on it withpath = "../egui-mtl4"instead of the git source;You're welcome to keep publishing it from your own repo as well; we'd just rather not have SixNG's own code come from outside the repo. Happy to merge once that's changed.
@maple-quartz18 on GitHub · 2026-11-27 21:52 UTC · original
Thanks for the clarification. I updated the branch accordingly:
crates/egui-mtl4is now restored as a SixNG workspace member with its ownCargo.toml,README.md,LICENSE, andsrc/lib.rs.sixng-guinow depends on it withpath = "../egui-mtl4".THIRD_PARTY_NOTICES.mdparagraph remains in place and is now accurate.maple-quartz18/egui-mtl4repository remains available as a publishing/synchronization mirror.For clarity,
Metal-Rustis different: it remains an independent Git dependency frommaple-quartz18/Metal-Rust; it is not copied into the SixNG workspace. SixNG's workspace crate is onlyegui-mtl4.The fix is pushed in commit
a5a450b, and the PR description has been updated to reflect this distinction. Local validation passes:cargo check --locked --workspacecargo test --locked -p egui-mtl4(3 passed)cargo build --locked -p sixng-gui --features metal4-poc --example metal4_window@holdmysocks on GitHub · 2026-11-27 22:21 UTC · original
Thanks, the in-repo
crates/egui-mtl4with the path dependency is exactly what we wanted.Two things before it can go in:
Cargo.lock: package metal-rust has inconsistent source rev. The pin check wants the full 40-character revision inCargo.toml(both[patch.crates-io]entries andcrates/egui-mtl4/Cargo.toml), so please use7f78fd2cc24f8dc4e3eec3178198a9b749df5dc8instead of7f78fd2, and the same full hash inTHIRD_PARTY_NOTICES.md.--zlib, the GUI checkbox and themetal_io_models_zlibcache. That's a separate feature from the painter extraction, and we'd like to review it on its own. If this PR keeps only the crate move (on the current0aa2a1fpin), we can merge it as soon as CI is green.Master is now on 0.13.0, so a merge from master will also be needed.
a5a450b0bbtoda3e44b37e@maple-quartz18 on GitHub · 2026-11-28 10:40 UTC · original
I rebuilt the PR from the current
master(0bb6fa5, SixNG0.14.0) and force-updated the branch toda3e44b.This version:
crates/egui-mtl4inside the SixNG workspace;path = "../egui-mtl4"fromsixng-gui;0aa2a1f694adf1a7e3ba877cc799e114d639df16in the workspace and lockfile;--zlib, the GUI checkbox, andmetal_io_models_zlib;gpu_drawmodule declaration needed by the Metal 4 example after rebasing onto current master.Validation passed:
cargo check --workspacepython3 scripts/check_metal_rust_pin.pycargo test --locked -p egui-mtl4(3 passed)cargo build --locked -p sixng-gui --features metal4-poc --example metal4_window@holdmysocks on GitHub · 2026-11-28 12:29 UTC · original
Merged, thanks! The rebuilt branch was exactly right. One small addition before merging: CI builds the whole workspace on Windows and Linux too, where
objc2(throughmetal-rust) doesn't compile, so I pushed a commit that makesmetal-rusta macOS-only dependency ofegui-mtl4and makes the crate empty on other platforms. I also pointed itsrepositoryfield at this repo, since it lives here now. Feel free to send the zlib model cache as its own PR whenever you're ready.