Skip to content

Precompile RT64 Metal shaders when the Metal toolchain runs - #86

Merged
swhitt merged 1 commit into
ThatGuyMcd:mainfrom
swhitt:macos-metallib-when-available
Nov 1, 2026
Merged

swhitt merged 1 commit into
ThatGuyMcd:mainfrom
swhitt:macos-metallib-when-available

Conversation

@swhitt

@swhitt swhitt commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

What

Follow-up to #83. RasterShader builds its library from the embedded MSL blobs for every combiner/other-mode combo (rt64_raster_shader.cpp:166-167), so with source blobs I think we were paying a full newLibraryWithSource compile per specialized shader, not just once at setup.

Now RT64 checks xcrun -sdk macosx metal -v at configure. If it runs (full Xcode, CI, release builds) we precompile metallibs like before. CLT-only still embeds source, so the no-Xcode build from #83 keeps working. -DDKR_RT64_PRECOMPILE_MSL=ON/OFF overrides it. plume already handles both blob types after #83, no change there.

Also fixed the leftover Prerequisites: Xcode and Homebrew. in Build-macOS.sh, reworded the host-tools python comment, and added a note to BUILDING.md.

Pattern checklist

  • First-party changes are in-place edits under runtime-recomp/, modding/ or scripts/ (no new patches/<name>/)
  • Third-party changes are *.patch files registered in patches/manifest.json (amends rt64/0021 + sha256)
  • Guest hooks only via guest-hooks/hooks.toml; symbols only via symbols/*.toml (n/a)
  • New settings, launcher pages and owned services are registered, and their contract docs are updated (n/a)
  • netplay/legacy_identity.hpp updated (reviewed by both owners) if simulation, wire or owned-service behaviour changed (n/a, renderer build only)
  • Tests added or updated; python scripts/check.py --suite all passes locally
  • Platforms considered: macOS only, iOS untouched. Ran the shader function in a stub harness against the real metal compiler: Xcode gives a metallib, CLT-only and =OFF give source. Haven't done a full game build with it yet.

Risk

Pretty low. Machines with the Metal toolchain go back to the pre-#83 path. The probe gets cached, so installing Xcode later needs a fresh configure (or =ON). Revert to roll back.

Fall back to embedded MSL source only on Command Line Tools-only hosts. Fix
leftover Xcode prereq text in Build-macOS.sh and host-tools comments.
@swhitt
swhitt merged commit a04c9df into ThatGuyMcd:main Nov 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant