Bringing Vulkan to Apple's Platforms: Khronos Group Announces Open Source MoltenVK 1.0 & SDKsby Nate Oh on February 26, 2018 9:01 AM EST
One of the unfortunate outcomes of Apple's desire to build their own top-to-bottom software ecosystems is that the company has gradually pulled away from supporting common APIs, particularly in graphics. Whereas early this decade Apple happily supported OpenGL ES up to 3.0, that's as far as the company ever went, skipping future OpenGL ES versions and OpenGL's successor, Vulkan. Instead Apple has relied on their own similar low-level API, Metal. As a result the widespread ability to use a single graphics API and target everything from PCs to Macs to smartphones has gradually been lost as old software and APIs grow stale.
Lost, perhaps, but as it turns out, not forgotten. Today, the Khronos Group, the industry consortium behind OpenGL and Vulkan, is announcing a wide-range of open-source tools, SDKs, and runtime library releases as part of their ongoing Vulkan Portability Initiative. The goal? To bring Vulkan applications to Apple platforms using Metal.
In collaboration with Valve, LunarG, and The Brenwill Workshop, this free open-source collection includes the full 1.0 release of the previously-commercial MoltenVK, a library for translating Vulkan API calls to Apple’s Metal 1 and 2 calls, as well LunarG’s new Vulkan SDK for macOS. Funding the costs of open-sourcing, Valve has been utilizing these tools on their applications, noting performance gains over native OpenGL drivers with Vulkan DOTA 2 on macOS as a production-load example.
Altogether, this forms the next step in Khronos’ Vulkan Portability Initiative, which was first announced at GDC 2017 as their “3D Portability Initiative,” and later refined as the “Vulkan Portability Initiative” last summer. Spurred by industry demand, Khronos is striving for a cross-platform API portability solution, where an appropriate subset of Vulkan can act as a ‘meta-API’-esque layer to map to DirectX 12 and Metal; the holy grail being that developers can craft a single Vulkan portable application or engine that can be seamlessly deployed across Vulkan, DX12, and Metal supporting platforms.
For the new generation of low-level low-overhead graphics APIs, the similar API philosophies makes this kind of mapping very feasible, particularly since Vulkan was designed with cross-vendor and cross-platform versatility in mind. Furthermore, both DX12 and glNext/Vulkan have been strongly influenced by AMD’s Mantle, which was donated wholesale to Khronos to form the modern foundation of Vulkan 1.0. The obstacle Khronos is tackling today is Apple’s Metal API, particularly as Apple continues with Metal development rather than adopting Vulkan and OpenGL ES 3.1+.
In accomplishing that, Khronos outlines several major parts: LunarG’s Vulkan macOS SDK and The Brenwill Workshop’s MoltenVK macOS/iOS runtime, as well as the open-source 'SPIRV-Cross' cross-compiler that MoltenVK utilizes. The open source LunarG Vulkan SDK unsurprisingly will allow developers to build, run and debug Vulkan applications on macOS platforms, including a number of loader and validation layers for API code.
Moving on, in short, SPIR-V is Khronos's existing common intermediate representation shader language, which the cross-compiler tool can in turn translate to a platform's native format, such as Metal Shading Language. And while MoltenVK 0.19 has existed as a paid product, Khronos noted that the fees and royalties did create a barrier to entry. On that front, Valve has been very eager to push Vulkan on macOS, and with their financial support MoltenVK has been open-sourced as the current full 1.0 release under the Apache 2.0 license, where it is free to use without development fees or royalties.
Khronos relayed that Valve very much intends MoltenVK to be a production-ready tool, and had Valve’s Vulkan DOTA 2 on macOS results at the ready, citing up to 50% faster framerates compared to native OpenGL. In any case, Khronos noted that the tools and SDKs were not specifically optimized for gaming applications, and applicable to browsers and other applications. And while there is technically an intermediate layer, Khronos stated that there are insignificant amounts of overhead, particularly in light of how Vulkan API calls are directly mapped to other low-level APIs.
Looking at Metal and DX12, almost all of Vulkan’s features are supported. The total unsupported operations add up to five general items, corresponding to around 20 function calls. In this way, Vulkan can be used as a portable subset, where different hardware and OS’ may support some of these exceptions. For the various generations of Apple platforms, the Metal 2 successor may enable yet more of those features; Apple’s relationship with Vulkan has not changed but the new Vulkan Portability tools are such that no support from Apple is needed. In the next few months, Khronos plans to publish final Vulkan portable subset definitions, working with AMD, NVIDIA, Unity, Mozilla, and others.
In the same vein, tentatively before the second half of the year Khronos and their collaborators are also planning to release tailored open-source conformance test layers, where only the features supported by a platform’s given Vulkan portable subset is tested. In addition, Khronos is looking to release simulation layers to flag the specific defined features not present in a given target system, along with various other enhanced SDK layers and tools. In general, any other SDK layers currently available under Windows are likely to be ported over to macOS at some point.
Moving forward, Khronos expects to continue releasing new portability tools, but additionally identified the current discussion over WebGL’s future and next-gen API possibilities as an avenue. Khronos also intends to continue widening platform support, noting development of the Rust-based gfx-rs for Vulkan portability, which remains in active development with the support of Mozilla and others.
The free and open source MoltenVK 1.0 can be found on the Khronos MoltenVK GitHub page, while the free macOS SDK is available through LunarXchange. Other tools can be found through Khronos’ Vulkan Portability resource page.
Source: Khronos Group
Post Your CommentPlease log in or sign up to comment.
View All Comments
iwod - Monday, February 26, 2018 - linkIsn't that the same with Microsoft. I mean most of the PC gaming platform is on Windows.
It really doesn't hurt everyone. Because I dont see Vulkan being used much.
WinterCharm - Tuesday, February 27, 2018 - linkYes. This is why DX 11 adoption is still so high among game developers.
WinterCharm - Tuesday, February 27, 2018 - linkApple was part of the Khronos Group. Likely, what they saw Vulkan doing wasn't good enough for their capabilities. Metal was created because Vulkan fell short.
mode_13h - Wednesday, February 28, 2018 - linkThis is garbage. Why do you blindly assume Apple can do better than all the GPU makers and games developers working together?
AMD's Mantle gave rise to Metal, Vulkan, and DX12, concurrently. If there's any *valid* reason for Apple to create Metal, it was probably that they didn't want to sit around and wait for Vulkan to materialize, as standards do take time. More likely, they were also eying the prospect of having another proprietary API to help keep their app developers in the corral.
Similar reason as why MS made Direct3D 12, instead of adopting Vulkan (except DX12 didn't come out that much before Vulkan).
Boland - Sunday, January 20, 2019 - linkMantle and Metal were released only months apart. Both were in development around the same time. Vulkan and DX12 followed much later.
WinterCharm - Tuesday, February 27, 2018 - linkI really want to see that OpenGL vs Vulkan slide also include Metal on there. My guess is that Metal will offer even more performance.
mode_13h - Wednesday, February 28, 2018 - linkStop trolling.
tipoo - Monday, March 12, 2018 - linkThis is Vulkan being shimmed through Metal, so that's necessarily true.
harryseth - Monday, May 28, 2018 - linkApple is getting ready for the launch of iOS 12 beta for developers. If you are interested in downloading/installing iOS 12 beta on iPhone or iPad device. It is now time to prepare for the rollout of iOS 12 update for your devices.
petersongame217 - Wednesday, August 5, 2020 - linkVulkan in the mac is much better than GT 650. I also have mac with Vulcan before and it was splendid. I was amazed by how fast it is for gaming and other search engines. I was hoping to have a new release mac on 2021.