mirror of
https://github.com/utmapp/dxmt.git
synced 2026-12-01 07:53:21 -10:00
The native build now cross-compiles for the headless Apple platforms (iOS/tvOS/visionOS and their simulators), keyed off meson's host_machine.subsystem(), which every Apple cross file must now declare. Everything resting on AppKit or the CoreGraphics display list is compiled out: no swapchains, monitors or adapters, so displays report a generic SDR profile and the display-setting store is inert. MetalFX is linked only where the SDK ships it (no simulator does; visionOS has no temporal scaler), and the airconv CLI is built only where it can run. The AIR a shader carries has to name the platform it will be loaded on, so the triple, air.version, SDK-version flag and the metallib container header (platform/OS fields as emitted by Apple's tools per -sdk) all follow the build target now instead of hardcoding macOS; the VERS tags are derived from the module's own air.version metadata. The bitcode is also downgraded the way Apple's tools do it: the optimization pipeline infers attributes (mustprogress, nofree, nosync, willreturn) that older OSes' AIR readers predate, and an unknown attribute is a fatal "LLVM ERROR" inside MTLCompilerService -- observed on iOS 16.3, and macOS 13's reader is of the same vintage. Runtime fixes for the same floor: MTLCopyAllDevices only reached the other platforms in iOS 18 (weak-linked, so calling it earlier jumps to NULL) and is replaced by the one-device array it would have returned; supportsBCTextureCompression is 16.4+ and reports false before that; the managed storage mode degrades to shared where only shared exists; and the shader cache falls back to NSSearchPathForDirectoriesInDomains where the app sandbox denies the dirhelper lookup behind confstr. Verified on an iPad Pro (M2, iPadOS 16.3.1): the full offscreen D3D11 suite passes with rendered images bit-identical to macOS. Co-Authored-By: Claude Fable 5 <[email protected]>