Metal | |
Developer: | Apple Inc. |
Latest Release Version: | 24 |
Programming Language: | Shading language C++14, Runtime/API: Objective-C |
Operating System: | iOS, iPadOS, macOS, tvOS |
Genre: | 3D graphics and compute API |
License: | Proprietary |
Metal is a low-level, low-overhead hardware-accelerated 3D graphic and compute shader API created by Apple, debuting in iOS 8. Metal combines functions similar to OpenGL and OpenCL in one API. It is intended to improve performance by offering low-level access to the GPU hardware for apps on iOS, iPadOS, macOS, and tvOS. It can be compared to low-level APIs on other platforms such as Vulkan and DirectX 12.
Metal is an object-oriented API that can be invoked using the Swift, Objective-C or C++17[1] programming languages. Full-blown GPU execution is controlled via the Metal Shading Language. According to Apple promotional materials: "MSL [Metal Shading Language] is a single, unified language that allows tighter integration between the graphics and compute programs. Since MSL is C++-based, you will find it familiar and easy to use."[2]
Metal aims to provide low-overhead access to the GPU. Commands are encoded beforehand and then submitted to the GPU for asynchronous execution. The application controls when to wait for the execution to complete thus allowing application developers to increase throughput by encoding other commands while commands are executed on the GPU or save power by explicitly waiting for GPU execution to complete. Additionally, command encoding is CPU independent thus applications can encode commands to each CPU thread independently. Lastly, render states are pre-computed beforehand, allowing the GPU driver to know in advance how to configure and optimize the render pipeline before command execution.[3]
Metal improves the capabilities of GPGPU programming by using compute shaders. Metal uses a specific shading language based on C++14, implemented using Clang and LLVM.[4]
Metal allows application developers to create Metal resources such as buffers, textures. Resources can be allocated on the CPU, GPU, or both and provides facilities to update and synchronize allocated resources. Metal can also enforce a resource's state during a command encoder's lifetime.[5] [6]
On macOS, Metal can provide application developers the discretion to specify which GPU to execute. Application developers can choose between the low-power integrated GPU of the CPU, the discrete GPU (on certain MacBooks and Macs) or an external GPU connected through Thunderbolt. Application developers also have the preference on how GPU commands are executed on which GPUs and provides suggestion on which GPU a certain command is most efficient to execute (commands to render a scene can be executed by the discrete GPU while post-processing and display can be handled by the integrated GPU).[7]
Metal Performance Shaders is a highly optimized library of graphics functions that can help application developers achieve great performance at the same time decrease work on maintaining GPU family specific functions.[8] It provides functions including:
Metal has been available since June 2, 2014 on iOS devices powered by Apple A7 or later,[9] and since June 8, 2015 on Macs (2012 models or later) running OS X El Capitan.[10]
On June 5, 2017, at WWDC, Apple announced the second version of Metal, to be supported by macOS High Sierra, iOS 11 and tvOS 11. Metal 2 is not a separate API from Metal and is supported by the same hardware. Metal 2 enables more efficient profiling and debugging in Xcode, accelerated machine learning, lower CPU workload, support for virtual reality on macOS, and specificities of the Apple A11 GPU, in particular.[11]
At the 2020 WWDC, Apple announced the migration of the Mac to Apple silicon. Macs using Apple silicon will feature Apple GPUs with a feature set combining what was previously available on macOS and iOS, and will be able to take advantage of features tailored to the tile based deferred rendering (TBDR) architecture of Apple GPUs.[12]
At the 2022 WWDC, Apple announced the third version of Metal (Metal 3), which would debut with the release of macOS Ventura, iOS 16 and iPadOS 16. Metal 3 introduces the MetalFX upscaling framework, which renders complex scenes in less time per frame with high-performance upscaling and anti-aliasing, mesh shaders support.[13] Also announced possibility to use C/C++ for Metal API.[14]
The first version of Metal supports the following hardware and software:[15]
The second version of Metal supports the following hardware and software:
The third version of Metal supports the following hardware and software:[16]
According to Apple, more than 148,000 applications use Metal directly, and 1.7 million use it through high-level frameworks, as of June 2017.[17] macOS games using Metal for rendering are listed below.
Title | Developer (macOS version) | Game engine | MacOS release date (OpenGL/DirectX) | Metal-based release date | Metal support notes | |
---|---|---|---|---|---|---|
Studio Wildcard | Unreal Engine 4 | |||||
ARMA 3 | Virtual Programming | Real Virtuality | Metal support in beta since | |||
Baldur's Gate III | Larian Studios | Divinity Engine 4.0 | Metal support in early access since | |||
Ballistic Overkill | Aquiris Game Studio | Unity Engine 5 | ||||
Feral Interactive | Unreal Engine 3 | Metal support since 21 February 2019 with v1.2 | ||||
Telltale Games | Telltale Tool | |||||
BattleTech | Harebrained Schemes | Unity Engine 5 | ||||
data-sort-value="Bioshock 1R" | Bioshock Remastered | Feral Interactive | Unreal Engine 2.5 | |||
data-sort-value="Bioshock 2R" | Bioshock 2 Remastered | Feral Interactive | Unreal Engine 2.5 | |||
Paradox Interactive | Unity Engine 5 | Metal support since | ||||
Civilization VI | Aspyr Media | LORE | Metal support since 5 April 2019 | |||
Company of Heroes 2 | Feral Interactive | Essence Engine 3 | Metal support since | |||
Feral Interactive | Dawn Engine | |||||
DiRT Rally | Feral Interactive | EGO Engine 2.5 | ||||
Larian Studios | Divinity Engine 2 | |||||
Dota 2 | Valve | Source 2 | MoltenVK was announced on .[18] The option to use this became available on .[19] | |||
data-sort-value="Elder Scrolls Online, The" | The Elder Scrolls Online | Zenimax Online Studios | N/A | OpenGL Renderer replaced with Vulkan via MoltenVK wrapper (translates Vulkan API calls to Metal) in patch 4.2.5 | ||
Feral Interactive | TW Engine 3 | Metal support since 16 December 2019 | ||||
EVE Online | CCP Games | N/A | Previously available on macOS via DirectX 9.0 from November 2007 until February 2009; native macOS version using Metal released 14 November 2021 | |||
Everspace | Rockfish | Unreal Engine 4 | ||||
F1 2016 | Feral Interactive | EGO Engine 4.0 | ||||
F1 2017 | Feral Interactive | EGO Engine 4.0 | ||||
Fortnite | Epic Games | Unreal Engine 4 | ||||
Gravel | Virtual Programming | Unreal Engine 4 | ||||
Telltale Games | Telltale Tool | |||||
Headlander | Double Fine Productions | Buddha Engine | ||||
Heroes of the Storm | Blizzard Entertainment | SC2 Engine | Metal support in beta since (temporarily removed on [20] until ?) | |||
Hitman | Feral Interactive | Glacier 2 | ||||
data-sort-value="Life Is Strange 0" | Feral Interactive | Unity Engine | ||||
data-sort-value="Life Is Strange 2" | Life Is Strange 2 | Feral Interactive | Unreal Engine 4 | |||
Mafia III | Aspyr Media | Illusion Engine | ||||
Feral Interactive | TW Engine 2 | Metal support since 25 October 2018 | ||||
Micro Machines World Series | Virtual Programming | Unity Engine 5 | ||||
Telltale Games | Telltale Tool | |||||
MXGP3 | Virtual Programming | Unreal Engine 4 | ||||
Feral Interactive | TW Engine 3 | Metal support since 25 October 2019 with v1.2 | ||||
Obduction | Cyan Worlds | Unreal Engine 4 | ||||
Observer | Bloober Team | Unreal Engine 4 | ||||
Quake II | id Software | Quake II engine | A port using MoltenVK was released as vkQuake2.[21] | |||
Refunct | Dominique Grieshofer | Unreal Engine 4 | ||||
Resident Evil Village | Capcom | RE Engine | First macOS game with MetalFX support | |||
Rise of the Tomb Raider | Feral Interactive | Foundation Engine | ||||
Shadow of the Tomb Raider | Feral Interactive | Foundation Engine | ||||
Sid Meier's Railroads! | Feral Interactive | Gamebryo | Metal support since | |||
data-sort-value="Sims 3, The" | The Sims 3 | Maxis Redwood Shores | The Sims 3 Engine | |||
data-sort-value="Sims 4, The" | The Sims 4 | Maxis | SmartSim | Metal support added | ||
Sky: Children of the Light | Thatgamecompany | N/A | Native Metal support added since pre-global live in November 2017 | |||
Starcraft | Blizzard Entertainment | Modified Warcraft II engine | Metal support since with v1.23.5 | |||
StarCraft II | Blizzard Entertainment | SC2 Engine | Metal support in beta since | |||
Tomb Raider | Feral Interactive | Foundation Engine | Metal support with v1.2 in July 2019 | |||
Total War: Rome Remastered | Feral Interactive | TW Engine 2 | ||||
Feral Interactive | TW Engine 3 | Metal support since 4 October 2019 | ||||
Feral Interactive | TW Engine 3 | Metal support since 4 October 2019 | ||||
Feral Interactive | TW Engine 3 | |||||
Feral Interactive | TW Engine 3 | |||||
Feral Interactive | TW Engine 3 | |||||
data-sort-value="Total WarSaga Thrones of Britannia" | Feral Interactive | TW Engine 3 | ||||
data-sort-value="Total WarSaga Troy" | Feral Interactive | TW Engine 3 | ||||
Universe Sandbox | Giant Army | Unity Engine 5 | Metal support in beta since June 2017 | |||
Unreal Tournament | Epic Games | Unreal Engine 4 | Metal support since January 2017 | |||
War Thunder | Gaijin Entertainment | Dagor Engine 4 | Metal support added (removed in ? 2018 and reintroduced) | |||
Feral Interactive | Essence Engine 4 | |||||
data-sort-value="Witness, The" | The Witness | Thekla, Inc | Thekla Engine | |||
World of Warcraft | Blizzard Entertainment | WoW Engine | Metal support since August 2016 | |||
X-Plane 11 | Laminar Research | N/A | Metal support in beta since [22] |