From a2d18d21cdbb3a3a306d640645f78acc88375c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 12:43:36 +0200 Subject: [PATCH] iOS: Make Metal the default graphics backend Not on tvOS, where the Metal backend hasn't been run yet. Existing installs keep the backend saved in their ini. The multi-swapchain plan now does Metal before Vulkan to match. Co-Authored-By: Claude Opus 5.5 (1M context) --- Core/Config.cpp | 5 ++++- docs/metal-backend.md | 9 +++++---- docs/multi-swapchain.md | 18 +++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index a0586f7799..69b502402d 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -536,8 +536,11 @@ static int DefaultGPUBackend() { return (int)GPUBackend::OPENGL; #endif -#elif PPSSPP_PLATFORM(IOS) && !defined(__LIBRETRO__) +#elif PPSSPP_PLATFORM(TVOS) && !defined(__LIBRETRO__) + // Metal hasn't been tried on tvOS yet. return (int)GPUBackend::VULKAN; +#elif PPSSPP_PLATFORM(IOS) && !defined(__LIBRETRO__) + return (int)GPUBackend::METAL; #endif // TODO: On some additional Linux platforms, we should also default to Vulkan. diff --git a/docs/metal-backend.md b/docs/metal-backend.md index 14def263cd..efda857ecf 100644 --- a/docs/metal-backend.md +++ b/docs/metal-backend.md @@ -1,8 +1,8 @@ # The Metal backend A native Metal backend for Mac and iOS (tvOS too), alongside OpenGL, D3D11 and Vulkan. It's selected as -`GPUBackend::METAL` (`--graphics=metal`), and Vulkan through MoltenVK stays the default for now. Written -2026-10-19; file references will drift. +`GPUBackend::METAL` (`--graphics=metal`). It's the default on iOS since 2026-10-22; Vulkan through MoltenVK +stays the default on Mac and tvOS. Written 2026-10-19; file references will drift. **Why:** programmable blending. Apple GPUs let a fragment shader read the color it's about to blend with (`[[color(0)]]`), so PSP blend modes that need shader blending no longer copy the framebuffer for every @@ -115,5 +115,6 @@ MoltenVK: wall time from 11.7% lower (Ridge Racer) to 2.6% higher, CPU time 2 to - **tvOS** shares the iOS code, but hasn't been built or run with Metal. - **The dev screen's pipeline list** is Vulkan only. - **Stereo rendering** (multiview, framebuffer arrays) is deliberately left out. -- **Making Metal the default and removing MoltenVK** are separate steps, after this has seen some use. The - render manager includes Vulkan headers for `GLSLtoSPV`, which has to change then. +- **Making Metal the default on Mac, and removing MoltenVK,** come later. Existing iOS installs keep the + backend saved in their ini; only new installs and reset settings get Metal. The render manager includes + Vulkan headers for `GLSLtoSPV`, which has to change before MoltenVK can go. diff --git a/docs/multi-swapchain.md b/docs/multi-swapchain.md index 69070aeea5..1e2da8f2c5 100644 --- a/docs/multi-swapchain.md +++ b/docs/multi-swapchain.md @@ -275,15 +275,15 @@ can be tested on its own. 1. **`OutputParams` refactor** of `PresentationCommon` and `CopyDisplayToOutput`. No change in behaviour, checked with frametests. -2. **thin3d `Swapchain` API plus Vulkan** (`VulkanSurfaceSwapchain`, presentation-for-everything, - per-output render manager state). Single-output path unchanged: unit tests, pspautotests, - frametests, an Android device. -3. **Dev client on macOS SDL:** a `--game-window` option opens a second SDL window as a `Game` output. - This tests most of the design in a fast loop, without AirPlay. Headless can add an offscreen - second output, so frametests can check what it shows. -4. **iOS TV mode,** on Vulkan (MoltenVK, still the iOS default), tested with the Apple TV. -5. **Metal backend,** before Metal becomes the iOS default (see `docs/metal-backend.md`), so TV mode - doesn't regress then. It's the simpler of the two. Then D3D11 when something wants it. +2. **thin3d `Swapchain` API plus Metal,** the iOS default. Single-output path unchanged: unit tests, + pspautotests, frametests. +3. **Dev client on macOS SDL:** a `--game-window` option opens a second SDL window as a `Game` output + (with `--graphics=metal`). This tests most of the design in a fast loop, without AirPlay. Headless + can add an offscreen second output, so frametests can check what it shows. +4. **iOS TV mode,** on Metal, tested with the Apple TV. +5. **Vulkan** (`VulkanSurfaceSwapchain`, presentation-for-everything, per-output render manager + state), for Android, the Mac default and Vulkan users on iOS. Single-output path unchanged: unit + tests, pspautotests, frametests, an Android device. Then D3D11 when something wants it. Open questions: - Does removing the external window resume mirroring?