Repository navigation
MetalSharp 1.0.0: the Arm64 FEX build on MetalSharp Wine - #744
Merged
Merged
Conversation
wine_runtime.c holds the one switch between the x86_64 Wine runtime (regular) and MetalSharp Wine (fex). On fex, runtime/wine becomes a facade over the signed MetalSharp-Wine.app: wrapper scripts that clear the x86_64 runtime's library, DLL and Vulkan paths and run the app's wine, a lib link and a writable etc. A 0.80.0 runtime is kept as runtime/wine-x86_64. /status and /update/check report the variant. The regular build's behavior is unchanged.
update.sh takes --variant (or reads it from the DMG name), compares it with the installed app's MetalSharpVariant, allows the same version only as a build switch, and checks the Developer ID team of FEX installs. /update/check offers this build's own asset and the other build as a switch; /update/start takes a variant.
- routes: Mullion for the D3DMetal, VKD3D and GPTK lanes, DXVK as its own lane, no native-first overrides, the x86_64 runtime's paths cleared; the Steam client, Rockstar launcher and Steam-launcher titles use Mullion - staging: Mullion and DXVK from the app, cleanup of the x86_64 build's DLLs - setup: MetalSharp-Wine.app copied, verified and made read-only instead of Rosetta and the runtime bundles; the Steam prefix gets wineboot, VC++ 2022 and the core fonts before Steam; Epic, GOG, Ubisoft and Sharp bottles likewise - migration: prefixes converted one way with an x86_64 backup, restored by the regular build on a switch back; setup.json records runtime_variant - process detection, dependencies, readiness, Wine Mono and x86 FNA games know the FEX layout; no Rosetta reinstall, wrapper patching or SDL linking on FEX
METALSHARP_VARIANT=fex builds MetalSharp.app with MetalSharp-Wine.app in Resources, never re-signed (inside-out signing skips it), no runtime bundles, and Info.plist MetalSharpVariant. Release CI's build-fex job downloads the pinned signed MetalSharp-Wine zip, checks it, and notarizes MetalSharp-<v>-arm64-FEX.dmg; the release job uploads both DMGs to one release.
The variant comes from /status and /update/check. On FEX the pipeline menus offer Mullion (DXMT), DXVK, D3D9, Wine and Mono/FNA, saved D3DMetal/VKD3D/M13 choices show as Mullion, the x87 toggle is hidden, the Backend row and setup wizard describe MetalSharp Wine, GPTK stays available through Rosetta, and the update dialog marks the current build and offers the other as a same-version switch.
…arp Wine wrapper The MetalSharp Steam helper app is for the x86_64 build only.
Steam URL handoffs on FEX use the direct launch's overrides.
…ne or GPTK cleans up - Mullion stages the 64-bit (ARM64X) set and Mullion (32) the i386 set, whatever the executable; DXVK its x86_64 set. - Saving a route that stages nothing (Wine, plain Wine, GPTK, D3DMetal) still removes the previous route's byte-identical DLLs. - Fix a free of a string literal in the FEX controller-shim path.
VKD3D no longer maps to Mullion on FEX: it runs GRAPHICS_BACKEND=vkd3d with the VKMT MoltenVK settings, and saving it stages VKD3D-Proton's d3d12/d3d12core/dxgi and DXVK's d3d9/10/11 from the app into the game folder. The wrappers (version 2) let vkd3d through.
…D3D DLLs in game folders Steam, Epic, GOG, Ubisoft and GameJolt games take their lane from <game>/.metalsharp/launch.env, which MetalSharp Wine applies however the game starts (through Steam, a launcher, or directly). On MetalSharp Wine the D3DMetal and GPTK lanes run on VKD3D-Proton, the D3D9 route on DXVK, DXVK is a lane of its own for x86_64 programs, and the OpenGL lane (Wine's Direct3D over WineMetalGL) passes each engine its OpenGL flag. Epic launches are tracked by process group, since legendary does not wait for the game. Route DLLs are no longer copied into game folders: MetalSharp Wine's loader routes every D3D and DXGI DLL to the lane's own copies by name, and copies beside the executable look like an injected proxy to anti-tamper (Dragon's Dogma 2 exited about 40 s in). Copies earlier versions staged are still removed.
…ullion's MetalFX and limits live in mullion.conf GET/POST /framerate sets a frame rate limit per lane: Mullion's in mullion.conf (d3d11 and d3d12), VKD3D-Proton's as VKD3D_FRAME_RATE. The Metal performance HUD (MTL_HUD_ENABLED) and MoltenVK's ray tracing on the VKD3D-Proton lane (DXR 1.1, feature level 12_2) are off until turned on. Mullion reads MetalFX and the limits from mullion.conf when a game starts, so a game the Steam client starts gets them without the client's environment.
…verts the 0.80.0 Steam prefix Setup stages support assets from MetalSharp Wine's share/metalsharp (Mono and FAudio from its archives) and MetalSharp.app's configs, so it needs no network, and shows each part of preparing a prefix as it runs. A 0.80.0 Steam prefix is backed up before it is converted, and migration does not copy the old one back over it. mullion.conf is MetalSharp's to edit; a dxmt.conf from before becomes it.
Settings for the frame rate limits, the Metal HUD and ray tracing on the FEX build, its logs, and the library's lanes as MetalSharp Wine has them.
…and external and network drive access Info.plist describes why Wine needs the Documents folder (games keep saves there) and external or network drives (Steam libraries), so macOS can ask instead of denying access.
…ain, and the source contract test finds it again
… extra route DLL cleanup apply to the FEX build only; the regular build behaves as on main
…etalFX starting off are the FEX build's; the regular build looks as on main
…nd the regular tests expect it off
… at the first Wine Steam start
… FEX updates swap in the new MetalSharp Wine without converting prefixes again, and only a move back from FEX restores x86_64 backups
…ch then ships without the FEX DMG
… VKD3D-Proton and DXVK caches per lane, and games keep those caches in the lanes' folders
… with early access, the graphics lanes and Get Into It
… back from FEX leaves no MetalSharp Wine app behind
…tion, every prefix included, without the updater's marker
…etalSharp Wine, at the same version too
…s before clearing Metal's cache that every Mullion game shares
…er builds left in a game's folders, once, at its next launch
…unning migration, and an install lock keeps both from replacing the app at once
…and names both DMGs
…s-fex.toml is the regular rules on MetalSharp Wine's lanes plus the games verified there
… and updates, and a changelog entry crediting Deadlock's fixes
…Wine and everything it carries are covered with their license texts
…eds METALSHARP_WINE_APP instead of a maintainer's path
…11 and D3D10 (welcome guide, changelog, architecture)
…o longer migrates at its second launch, and a Steam prefix MetalSharp Wine built reads as FEX
…nloaded regular DMG instead of recovering, and so reinstalling, FEX
…, swapped in safely and then consumed, and a failed restore leaves the build unrecorded to retry
…-recover for the regular build updating itself, the downloaded DMG with its variant otherwise
Collaborator
Author
|
Released as MetalSharp 1.0.0. The tag is on merge commit b44cc0f, and Release CI run 40653045054 passed: both DMG builds succeeded and the release was published. What shipped
Components
Checked before merging
Known follow-ups
Thanks to @MohamedElGhandour for #741 and #742. |
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.
MetalSharp 1.0.0 adds an Arm64 FEX build (
VARIANT=fex). It runs games on MetalSharp Wine v4.0, an arm64 Wine 11.20 that runs x86 code through FEX, with no Rosetta. The regular x86_64 build behaves as on main: every FEX behavior sits behind the backend's compile-time variant (MS_BACKEND_VARIANT) or the app's variant (app-gpui/src/variant.rs). The updater moves between the two builds.What changes on the FEX build
<game>/.metalsharp/launch.env. MetalSharp Wine applies that file however the game starts, whether from Steam, a launcher, or its executable.GET/POST /framerate), a Metal HUD switch, and ray tracing on the VKD3D-Proton lane.mullion.conf.shader-cache/fex-<lane>andpipeline-cache/fex-<lane>, throughVKD3D_SHADER_CACHE_PATH,DXVK_STATE_CACHE_PATHandMULLION_SHADER_CACHE_PATH. Mullion's Clear empties MetalSharp's per-game caches, and asks first before also clearing the Metal cache that every Mullion game shares. The caches earlier FEX builds left in game folders (vkd3d-proton.cache,<exe>.dxvk-cache) are removed once, at the game's next launch.Update paths
Migration takes an explicit path, decided from the running build, the build recorded in
setup.json(runtime_variant; missing on 0.80.x means regular) and the version it was migrated at:update.sh --recover) reinstalls the installed build. On FEX that is the FEX DMG with its MetalSharp Wine, at the same version too.Release and CI
MetalSharp-Wine-4.0-arm64.zip, checked againstSHA256SUMS). If the FEX build fails, the regular release goes out without the FEX DMG instead of being blocked.make VARIANT=fex test.docs/arm64-fex-1.0-plan.md.Testing
make -C app/src-candmake -C app/src-c VARIANT=fex BUILD_DIR=build-fexboth build with-Werror.make -C app/src-c test(regular) andmake -C app/src-c VARIANT=fex BUILD_DIR=build-fex testpass. They cover the migration paths, removing read-only runtime folders, the per-lane caches, the old-cache cleanup, the install lock, and FEX recovery and build switches.cargo fmt --check,cargo checkandcargo testpass inapp-gpui, as do the backend source contracts and the route inventory check.