Skip to content

MetalSharp Wine 4.0

Choose a tag to compare

@aaf2tbz aaf2tbz released this 28 Oct 07:22
· 38 commits to main since this release

MetalSharp Wine 4.0 is Wine 11.20 as a native arm64 macOS app, with a FEX fork for x86_64 and 32-bit x86 Windows programs. It needs no Rosetta. It is the runtime of MetalSharp 1.0.0's Arm64 FEX build. This release converts D3D12 shaders with Apple's Metal Shader Converter on the VKD3D-Proton lane, adds trace logging to every graphics layer, and fixes several games' crashes and hangs.

What's new since 3.0

  • VKD3D-Proton macOS 4.5 and Apple's Metal Shader Converter:
    • Faster shader setup: the converter turns compute shaders, and pipelines of a vertex and a pixel shader, into Metal libraries directly, skipping the MSL front-end compile (0.4–1.7 s per large shader). It is used unmodified, under Apple's license. METALSHARP_MSC=0 turns it off; METALSHARP_MSC=compute keeps it to compute shaders.
    • SPIR-V where the converter can't be correct: shaders that a game's quirk tables change, and pixel shaders with wave operations (the converted code counts helper lanes, and their waterfall loops hung the GPU), stay on SPIR-V.
    • Null descriptors read a zeroed buffer and texture.
    • MoltenVK: residency sets count each allocation (Dragon's Dogma 2 faulted at its first submit), and RGB9E5 targets blend on Apple GPUs.
    • SPIRV-Cross: vertex shaders that use wave operations convert.
    • Five-game fixes: The Witcher 3's 17 GiB layered pass, Ghostrunner's tessellation-plus-geometry freeze, and memory growth in Red Dead Redemption 2 and God of War Ragnarök.
  • Mullion, merged with upstream Mullion:
    • Dragon's Dogma 2 plays: a pixel shader's WaveReadLaneFirst gives every lane the first non-helper lane's value. Its waterfall loops never ended, and the GPU hung at the title screen.
    • No GPU work after device removal: a removed device no longer commits GPU work.
    • Faster encoding: queues encode on several threads again on Metal 3, and with Metal 4 where the system has it.
    • Config file: d3d11.metalSpatialUpscale turns MetalFX upscaling on from mullion.conf.
    • Large texture buffers: views are clamped to Metal's limit (fixes Marvel's Spider-Man; antoninmuller, #3).
  • Trace logging:
    • Mullion: MULLION_TRACE_<CATEGORY>=1 or heavy, per category (gpu, sync, resource, memory, shader, present, pass, api, cpu). It logs to ~/Library/Logs/Mullion/<exe>/mullion.log.
    • VKD3D-Proton and MoltenVK: METALSHARP_TRACE=<category>[+heavy].
    • Flight recorder: Mullion keeps one that names the module of a faulting address.
  • Wine:
    • .metalsharp/launch.env: a program's folder can carry its own environment, applied however the program is started (MetalSharp's per-game graphics routes).
    • .metalsharp/launch-exe and launch-args: pick the executable and its arguments.
    • \??\GLOBALROOT paths resolve, which Arxan-protected games use to open their own image.
    • FileAllocationInformation is implemented.
    • WriteProcessMemory writes into code pages on macOS (Trackmania's hook engine).
    • Other: QueryWorkingSetEx reads residency with mincore(), and NtRaiseHardError logs its message.
  • Offline setup: Wine Mono and FAudio ship as archives in share/metalsharp/archives, and the default graphics config is mullion.conf.

Downloads

  • MetalSharp-Wine-4.0-arm64.zip: the signed and notarized MetalSharp-Wine.app. It needs macOS 15 or later, and macOS 26.4 or later for 32-bit (i386) programs.
  • metalsharp-wine-4.0-arm64.tar.xz: a relocatable folder (bin/wine). It is ad-hoc signed, so it runs x86_64 and ARM64 programs only.
  • SHA256SUMS

What's in it

  • CPU translation: ARM64 runs natively, x86_64 through FEX and ARM64EC (Wine's DLLs are ARM64X), and i386 through FEX and WoW64. TSO emulation and msync are on by default.
  • Direct3D:
    • Mullion (DXMT fork) on Metal is the default for D3D10/11/12.
    • VKD3D-Proton macOS 4.5 (GRAPHICS_BACKEND=vkd3d, with Apple's Metal Shader Converter) and DXVK-macOS 1.10.x (GRAPHICS_BACKEND=dxvk) are opt-in for x86_64 programs.
    • GRAPHICS_BACKEND=wine selects wined3d.
  • OpenGL: WineMetalGL 3.7.0 (OpenGL 4.6 on Metal) is the default. OPENGL_BACKEND=wine selects Wine's own.
  • Vulkan: MoltenVK 1.4.3 (MetalSharp build, with persistent pipeline caches).
  • Media: FFmpeg 8.0 and GStreamer 1.26.
  • .NET and HTML: Wine Mono 11.3.0 and Wine Gecko 2.47.4.
  • Shader compilers: Microsoft's DXC 1.9 and the ARM64 d3dcompiler_47.dll in every prefix.

Tested on the signed build

  • CPU translation: hello runs on all three architectures (ARM64 native, x86_64 through FEX, i386 through WoW64), and msync is active with no environment variables set.
  • OpenGL: OpenGL 4.6 through WineMetalGL 3.7.0 works on ARM64, x86_64 and i386.
  • Vulkan: Vulkan through MoltenVK works on ARM64 and x86_64.
  • D3D11: works on Mullion for x86_64 and i386.
  • D3D12: works on Mullion, and on VKD3D-Proton with the Metal Shader Converter (x86_64).
  • Games: Dragon's Dogma 2 runs on Mullion. Red Dead Redemption 2, God of War Ragnarök and PEAK were tested on 3.0's lanes, whose code is in this release. The VKD3D-Proton lane's Dragon's Dogma 2 fixes (v4.5) are new and not yet confirmed in game.

Source: main holds the build scripts, patches, docs and tests. The modified sources are on the source/wine, source/fex and source/winemetalgl branches. Mullion is developed at aaf2tbz/mullion and sent upstream to dttdrv/mullion (#70, #71). VKD3D-Proton and MoltenVK are developed at metalsharp/VKD3D-Proton-MacOS (v4.5), and DXVK-macOS at metalsharp/DXVK-macOS-1.10. Apple's libmetalirconverter.dylib ships unmodified under its own license (see PROVENANCE).