Metal (API)
Metal is a low-level, low-overhead hardware-accelerated 3D graphic and compute shader application programming interface (API) developed by Apple Inc., and which debuted in iOS 8. Metal combines functions similar to OpenGL and OpenCL under 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.
Apple used the mobile multiplayer online battle arena game Vainglory to demonstrate Metal's graphics capabilities at the iPhone 6's September 2014 announcement event[1] | |
Developer(s) | Apple Inc. |
---|---|
Initial release | June 2014 |
Stable release | 3
/ June 2019 |
Written in | Shading Language: C++14, Runtime/API: Objective-C |
Operating system | iOS, iPadOS, macOS, tvOS |
Type | 3D graphics and compute API |
License | proprietary |
Website | developer |
Metal is an object-oriented API that can be invoked using the Swift or Objective-C 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]
Features
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 wait 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; this is implemented using Clang and LLVM.[4]
Metal offers application developers the flexibility where to create Metal resources (Buffers, Textures, etc.). 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 when 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
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 such as:
- Image filtering algorithms
- Neural network processing
- Advance math operations
- Ray tracing
History
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]
Supported GPUs
On iOS, tvOS, and macOS, Metal supports Apple-designed SoCs from the Apple A7 or newer. On macOS, Metal also supports Intel HD and Iris Graphics from the HD 4000 series or newer, AMD GCN, and AMD RDNA GPUs. NVIDIA GPUs are supported but Metal drivers for newer devices (10 Series and newer) are not available since macOS Mojave. [13]
Adoption
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.[14] macOS games using Metal for rendering are listed below.
Title | Developer (macOS version) | Game engine | Release date (macOS) | Notes |
---|---|---|---|---|
Civilization VI | Aspyr | 24 October 2016 | Metal support since 5 April 2019
Bug: Windowed-mode only using Metal. May or may not be fixed in the future | |
Batman: Arkham City | Feral Interactive | 18 October 2013 | Metal support since 21 February 2019 with v1.2 | |
Dota 2 | Valve | Source 2 | 18 July 2013 | The use of MoltenVK to support Metal via Vulkan was announced on 26 February 2018.[15] The option to use this became available on 31 May 2018.[16] |
Quake 2 | id Software | Quake II engine | 9 February 2019 | The original game using MoltenVK to support Metal via Vulkan was released to the public as vkQuake2.[17] |
Tomb Raider | Feral Interactive | 17 January 2014 | Metal support with v1.2 in July 2019 | |
Rise of the Tomb Raider | Feral Interactive | Foundation engine | 12 April 2018 | Metal support shipping at launch |
Shadow of the Tomb Raider | Feral Interactive | Foundation Engine | 2019 | Metal support shipping at launch |
F1 2016 | Feral Interactive | EGO Engine 4.0 | 6 April 2017 | Metal support shipping at launch |
Life is Strange 2 | Feral Interactive | Unreal Engine 4 | 2019 | Metal support shipping at launch |
Life is Strange: Before the Storm | Feral Interactive | Unity Engine | 13 September 2018 | Metal support shipping at launch |
Divinity: Original Sin 2 | Larian Studios | Divinity Engine 2 | 31 January 2019 | Metal support shipping at launch |
Company of Heroes 2 | Feral Interactive | Essence Engine 3 | 21 January 2015 | Metal support since 19 October 2018 |
Hitman | Feral Interactive | Metal support shipping at launch
Not available on the Mac App Store. Steam and Feral Stores only. | ||
Sid Meier's Railroads! | Feral Interactive | Gamebryo | 1 November 2012 | Metal support since 18 December 2018 |
Warhammer 40,000: Dawn of War III | Feral Interactive | Essence Engine 4 | 9 June 2017 | Metal support shipping at launch |
Total War: Warhammer | Feral Interactive | Total War Engine 3 | 19 April 2017 | Metal support shipping at launch |
Total War: Warhammer 2 | Feral Interactive | Total War Engine 3 | 20 November 2018 | Metal support shipping at launch |
Total War Saga: Thrones of Britannia | Feral Interactive | Total War Engine 3 | 24 May 2018 | Metal support shipping at launch |
Medieval II: Total War | Feral Interactive | Total War Engine 2 | 17 December 2015 | Metal support since 25 October 2018 |
Empire: Total War | Feral Interactive | 4 March 2009 | Metal support since 16th December 2019 | |
Napoleon: Total War | Feral Interactive | 2 July 2013 | Metal support since 25th of October 2019 with v1.2 | |
Total War: Shogun 2 | Feral Interactive | 31 July 2014 | Metal support since 4th of October 2019 | |
Total War: Shogun 2: Fall of the Samurai | Feral Interactive | 18 December 2014 | Metal support since 4th of October 2019 | |
Bioshock Remastered | Feral Interactive | Unreal Engine 2.5 | 22 August 2017 | Metal support shipping at launch |
F1 2017 | Feral Interactive | EGO Engine 4.0 | 25 August 2017 | Metal support shipping at launch |
Deus Ex: Mankind Divided | Feral Interactive | Dawn Engine | 12 December 2017 | Metal support shipping at launch |
DiRT Rally | Feral Interactive | EGO Engine 2.5 | 16 November 2017 | Metal support shipping at launch |
Ballistic Overkill | Aquiris Game Studio | Unity Engine 5 | 28 March 2017 | Metal support shipping at launch |
BattleTech | Harebrained Schemes | Unity Engine 5 | 24 April 2018 | Metal support shipping at launch |
Mafia III | Aspyr Media | Illusion Engine | 11 May 2017 | Metal support shipping at launch |
World of Warcraft | Blizzard Entertainment | WoW Engine | 23 November 2004 | Metal support since August 2016 |
Starcraft | Blizzard Entertainment | Metal support in since 2 July 2020 with v.1.23.5 | ||
StarCraft II | Blizzard Entertainment | SC2 Engine | 27 July 2010 | Metal support in beta since 24 January 2017 |
Heroes of the Storm | Blizzard Entertainment | SC2 Engine | 2 June 2015 | Metal support in beta since 24 January 2017,
temporarily removed on 29 November 2017 |
Fortnite | Epic Games | Unreal Engine 4 | 25 July 2017 | Metal support shipping at launch |
Obduction | Cyan Worlds | Unreal Engine 4 | 29 March 2017 | Metal support shipping at launch |
Everspace | Rockfish | Unreal Engine 4 | 26 May 2017 | Metal support shipping at launch |
Ark: Survival Evolved | Studio Wildcard | Unreal Engine 4 | 29 August 2017 | Metal support shipping at launch |
Observer | Bloober Team | Unreal Engine 4 | 24 October 2017 | Metal support shipping at launch |
Unreal Tournament | Epic Games | Unreal Engine 4 | TBA | Metal support since January 2017 |
Refunct | Dominique Grieshofer | Unreal Engine 4 | 5 September 2016 | Metal support shipping at launch |
Cities: Skylines | Paradox Interactive | Unity Engine 5 | 10 March 2015 | Metal support since 18 May 2017 |
Universe Sandbox 2 | Giant Army | Unity Engine 5 | TBA | Metal support in beta since June 2017 |
War Thunder | Gaijin Entertainment | Dagor Engine 4 | 1 November 2012 | Metal support added 24 May 2017, removed at some point in 2018 |
The Witness | Thekla, Inc | Thekla Engine | 8 March 2017 | Metal support shipping at launch |
Micro Machines World Series | Virtual Programming | Unity Engine 5 | 30 June 2017 | Metal support shipping at launch |
Guardians of the Galaxy: The Telltale Series | Telltale Games | Telltale Tool | 18 April 2017 | Metal support shipping at launch |
Batman: The Enemy Within | Telltale Games | Telltale Tool | 8 August 2017 | Metal support shipping at launch |
Minecraft: Story Mode - Season Two | Telltale Games | Telltale Tool | 11 July 2017 | Metal support shipping at launch |
ARMA 3 | Virtual Programming | Real Virtuality | TBA | Metal support in beta since 17 September 2017 |
MXGP3 | Virtual Programming | Unreal Engine 4 | 23 November 2018 | Metal support shipping at launch |
Gravel | Virtual Programming | Unreal Engine 4 | 20 January 2019 | Metal support shipping at launch |
X-Plane 11 | Laminar Research | Custom engine | 30 May 2017 | Metal support in public beta. 2 April 2020[18] |
Headlander | Double Fine Productions | Buddha Engine | 18 November 2016 | Metal support shipping at launch |
The Sims 4 | Maxis | Custom engine | 17 February 2015 | Metal support added 12 November 2019 |
See also
References
- McWhertor, Michael (September 9, 2014). "This is the game Apple used to show off iPhone 6". Polygon. Vox Media. Archived from the original on September 10, 2014. Retrieved September 9, 2014.
- Apple Inc. "Metal Shading Language Specification" (PDF).
- "Setting Up a Command Structure". Apple Inc.
- "Metal Shading Language Guide". September 8, 2014. Retrieved September 10, 2014.
- Apple Inc. "Setting Resource Storage Mode".
- "Synchronizing a Managed Resource". Apple Inc.
- "GPU Selection in macOS". Apple Inc.
- "Metal Performance Shaders".
- Machkovech, Same (June 2, 2014). "Apple gets heavy with gaming, announces Metal development platform". Ars Technica. Condé Nast.
- Smith, Colin; Meza, Starlayne (June 8, 2015). "Apple Announces OS X El Capitan with Refined Experience & Improved Performance". Newsroom. San Francisco: Apple.
- "Archived copy of the Metal homepage, November 2017". Apple Developer. Apple. November 20, 2017. Archived from the original on November 20, 2017 – via Wayback Machine.CS1 maint: BOT: original-url status unknown (link)
- "Bring your Metal app to Apple Silicon Macs". developer.apple.com. Retrieved July 13, 2020.
- Chiappetta, Marco (December 11, 2018). "Apple Turns Its Back On Customers And NVIDIA With macOS Mojave".
- Apple Inc. "WWDC 2017 Platforms State of the Union".
- Nestor, Marius. "Vulkan Support Is Finally Coming to Apple's macOS & iOS to Make Games Run Faster". softpedia. Retrieved February 28, 2018.
- Larabel, Michael (June 1, 2018). "Initial Vulkan Performance On macOS With Dota 2 Is Looking Very Good". Phoronix. Retrieved June 5, 2018.
- Kondrak, Krzysztof [@k_kondrak] (January 9, 2019). "vkQuake2 gets MacOS support" (Tweet). Retrieved February 9, 2019 – via Twitter.
- "X-Plane 11.50 Public Beta 1: Vulkan and Metal Are Here". X-Plane Developer. April 2, 2020. Retrieved April 2, 2020.
External links
- Metal for Developers
- Metal Programming Guide (preliminary)
- WWDC14 demo; extended version
- Install macOS 10.14 Mojave on Mac Pro (Mid 2010) and Mac Pro (Mid 2012) - Apple article explaining what GPUs are compatible with Apple's Metal APIs on Mac OS 10.14 (Mojave) operating system