Repository navigation
Conversation
v0lumehi
force-pushed
the
nsp-mac-only
branch
from
October 23, 2026 15:59
cd823e0 to
196631b
Compare
…M = 'mac' in Spyder; ios stays the default and builds as before). It runs the steps the Mac host needs: extraction, rewrite, run-time captures and decodes, heap check and shader split. It builds only the Mac shader libraries: dmsh_build.py without IOSOUT (one inherited from the caller's environment is dropped), and a Vulkan or GL game's library without --ios. Then it builds the Mac host for the profile into <id>_build/tools/dmhost (make's compile line, DM_GAMES_DIR / DM_GAMES_FIRST as for the captures) and the button-icon font into <id>_build/font. It skips the iOS shaders, the Xcode project and the IPA, and keeps the extracted files whatever --keep-extracted says. Its last line is the command that runs the game: DM_ROOT, DM_ROMFS, DM_SAVE / DM_TEMP in <id>_build/run (kept from run to run), DM_MSL_DIR, DM_FONT_DIR, DM_AOC_DIR with DLC, DM_NVN_SHMAP for an NVN game (the host outside dm/host does not find the shader map beside itself), DM_LANG, DM_WINDOW=1, DM_AUDIO=1 and the --env-file switches. Why: a developer who only runs a game on the Mac waited for the iOS shaders (Mario Kart 8 Deluxe: about 30,000, roughly doubling the shader time) and needed room for the IPA (about 12 GB). The Mac stays a development host (GitHub issue seedds#64), so this is a script option, not a Mac app. It needs Apple silicon and cannot be combined with --prepare-xcode. Reuse: each shader output now has its own key, named after the one chain version (DMSH_CHAIN in dm/gfx/nvn/dmsh_chain.h). The iOS libraries keep shader/ios/b-<chain>.key and shader/ios/vk.key / gl.key. The Mac's are shader/mac-b-<chain>.key (outside shader/cache, whose b-* entries dmsh_build.py reads as library folders) and shader/vk.key / gl.key. An iOS build writes both keys, since it builds the Mac's libraries too, and a Mac-only build is reused after either, so a folder already packed as an IPA needs no shader work. Either key is taken only while the Mac libraries carry a full dmsh_build.py run's stamp (b-<chain>/inputs.tsv), and c1_full.tsv / cb_extent.tsv that do not name it are made again from them (chain_tables, as for the IPA); a Mac-only full build stamps the Mac libraries and writes both tables itself. An iOS build after a Mac-only one still makes the iPhone's libraries. It translates again (dmsh_build.py's per-shader cache keys include the iOS compile convention), but takes the Mac libraries from the Metal compile cache. The Mac host build (build_mac_host, also used by the captures, the heap check and the Oodle decodes) is now reused while its compile line, the sources of the folders it compiles from (the chain header dm/gfx/nvn/dmsh_chain.h among them), the generated profile header, libvpx, the third-party headers, clang and the macOS SDK are unchanged. The Vulkan and GL shader steps share one function (layer_shaders). The default ios platform builds as before. docs/development.md documents the option (an example, the Spyder setting, a section "A Mac-only build for development" with the run command and the reuse rules), and "Build by hand (Mac)" points to it. README.md is unchanged: the option is for developers. Checked: dm/tools/tests (34 tests, 11 in test_nsp_mac.py: Mac-only shader builds without --ios or IOSOUT, the keys, reuse after an iOS build, a rebuild for iOS after a Mac-only build, no reuse of Mac libraries without a stamp, a stale table made again on reuse, the environment file). Hades in Mac mode, from its folder built for Xcode earlier: 5 stages (nx_extract, extract reused, rewrite rerun for the split rewriter in 8 s, 74 Vulkan shaders for the Mac in 4 s, Mac host in 17 s). The iOS output in shader/ios was untouched, there was no Xcode step or IPA, the run command was printed and the exit code was 0. The game itself was not started.
v0lumehi
force-pushed
the
nsp-mac-only
branch
from
October 23, 2026 17:16
196631b to
e9ca115
Compare
seedds
added a commit
that referenced
this pull request
Oct 23, 2026
…g a game on this Mac needs, from PR #82 A development option; the Mac is the development host, not a platform for players. The same steps up to the shaders (extraction, DLC, rewrite, run-time captures and decodes, heap check, shader split), then only the Mac's: dmsh_build.py without IOSOUT (an inherited one is dropped), a Vulkan or GL game's library without --ios, the Mac host for the profile into <id>_build/tools/dmhost (build_mac_host, through DM_GAMES_DIR / DM_GAMES_FIRST for a provisional or derived profile) and the button-icon font into <id>_build/font. No iOS shaders, Xcode project or IPA; the extracted files are kept whatever KEEP_EXTRACTED says, and the last line is the command that runs the game (its save in <id>_build/run/save, DM_NVN_SHMAP for an NVN game, DM_AOC_DIR with DLC, the --env-file switches). It refuses --prepare-xcode and an Intel Mac. Reuse: the Mac libraries have a key of their own (shader/mac-b-<chain>.key beside the cache folder, shader/vk.key / gl.key), which an iOS build writes too, so a Mac-only build after an IPA reuses its shaders; either key only while the Mac libraries carry a full build's stamp (inputs.tsv). An iOS build after a Mac-only one translates again (dmsh_build.py's per-shader keys include the iOS compile convention) and takes the Mac libraries from the Metal compile cache. build_mac_host now has a reuse key too (the compile line, the sources and headers of the folders it compiles, the generated profile header, libvpx, the third-party headers, clang and the SDK), which also saves the rebuild for the Oodle / LZ5 decodes and the run-time captures. build_vk_shaders and build_gl_shaders share layer_shaders. The default (ios) path builds as before. Checked: dm/tools/tests 34 of 34 (11 in the new test_nsp_mac.py); Hades in Mac mode ran the Mac stages only, printed the run command and exited 0, and a second run reused every stage, the host included (2 s); the host it built boots Hades from that command. Breath of the Wild (NVN, with DLC) in Mac mode restored its 19,592 shaders from the cache, printed a command with DM_AOC_DIR and DM_NVN_SHMAP, and the host booted it from that command into play. Not run end to end here: a GL, provisional or derived game in Mac mode, and an IPA after a Mac-only build (unit tests with the tools stubbed). Co-authored-by: v0lumehi <[email protected]>
Owner
|
Thanks! Ported as 98a91a6, unchanged. I checked that Checked here:
Not run here: a GL, provisional or derived game in Mac mode, and an IPA after a Mac-only build. The unit tests cover those. |
Know-It-All-Brother
pushed a commit
to Know-It-All-Brother/nxnative
that referenced
this pull request
Nov 9, 2026
…g a game on this Mac needs, from PR seedds#82 A development option; the Mac is the development host, not a platform for players. The same steps up to the shaders (extraction, DLC, rewrite, run-time captures and decodes, heap check, shader split), then only the Mac's: dmsh_build.py without IOSOUT (an inherited one is dropped), a Vulkan or GL game's library without --ios, the Mac host for the profile into <id>_build/tools/dmhost (build_mac_host, through DM_GAMES_DIR / DM_GAMES_FIRST for a provisional or derived profile) and the button-icon font into <id>_build/font. No iOS shaders, Xcode project or IPA; the extracted files are kept whatever KEEP_EXTRACTED says, and the last line is the command that runs the game (its save in <id>_build/run/save, DM_NVN_SHMAP for an NVN game, DM_AOC_DIR with DLC, the --env-file switches). It refuses --prepare-xcode and an Intel Mac. Reuse: the Mac libraries have a key of their own (shader/mac-b-<chain>.key beside the cache folder, shader/vk.key / gl.key), which an iOS build writes too, so a Mac-only build after an IPA reuses its shaders; either key only while the Mac libraries carry a full build's stamp (inputs.tsv). An iOS build after a Mac-only one translates again (dmsh_build.py's per-shader keys include the iOS compile convention) and takes the Mac libraries from the Metal compile cache. build_mac_host now has a reuse key too (the compile line, the sources and headers of the folders it compiles, the generated profile header, libvpx, the third-party headers, clang and the SDK), which also saves the rebuild for the Oodle / LZ5 decodes and the run-time captures. build_vk_shaders and build_gl_shaders share layer_shaders. The default (ios) path builds as before. Checked: dm/tools/tests 34 of 34 (11 in the new test_nsp_mac.py); Hades in Mac mode ran the Mac stages only, printed the run command and exited 0, and a second run reused every stage, the host included (2 s); the host it built boots Hades from that command. Breath of the Wild (NVN, with DLC) in Mac mode restored its 19,592 shaders from the cache, printed a command with DM_AOC_DIR and DM_NVN_SHMAP, and the host booted it from that command into play. Not run end to end here: a GL, provisional or derived game in Mac mode, and an IPA after a Mac-only build (unit tests with the tools stubbed). Co-authored-by: v0lumehi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A development option:
--platform mac(orPLATFORM = 'mac'in the settings block for Spyder) prepares a game to run on the Mac and stops there. It skips the iOS shader libraries, the Xcode project, the app build and the IPA. For Mario Kart 8 Deluxe that saves about half the shader time (around 30,000 iOS libraries) and the ~12 GB IPA when all you want is a Mac run to test or debug. The default staysios, which builds exactly as before.Mac mode
own_compilers.pywithoutIOSOUT(an inherited one is dropped). Vulkan and GL games build their Mac library without--ios.build_mac_hostbuilds the host into<id>_build/tools/dmhost, honouringDM_GAMES_DIR/DM_GAMES_FIRSTfor provisional and derived profiles. The checkout'sdm/host/dmhostis left alone. It also writes the button-icon font into<id>_build/font.--keep-extractedsays, since the Mac run reads the RomFS.DM_NVN_SHMAPfor NVN games,DM_AOC_DIRwith DLC, and the--env-fileswitches. The save goes to<id>_build/run/save.--prepare-xcode, and an Intel Mac.Reuse
shader/mac-b-<chain>.key,shader/vk.key/gl.key). An iOS build writes both keys, so a folder already built for iOS needs no shader work in Mac mode.dmsh_build.py's per-shader cache key includes the iOS settings, and changing that would change every profile's chain version, so it is left as it is.Checked
dm/tools/tests: all 24 pass, 9 of them new intest_nsp_mac.py.Docs: a section "A Mac-only build for development" in
docs/development.md, with a pointer from "Build by hand (Mac)". README is unchanged, since it is player-facing.Rebased onto 86d9ba1 (one chain version for every game) and f4f0a85: the Mac key follows the single chain version, a Mac-only build reuses the Mac libraries only while
shader/cache/b-<chain>has a full build'sinputs.tsvstamp, and makesc1_full.tsv/cb_extent.tsvlike an iOS build. Theiosdefault behaves exactly as on main.dm/tools/tests: 34 pass (11 intest_nsp_mac.py, two new for the stamp). Hades in Mac mode: Mac stages only, run command printed, exit 0.