Vulkan Apps Now Compatible With macOS and iOS

by

Popular cross-platform 3D graphics and compute API Vulkan is gaining support for the Apple ecosystem, which means Mac and iOS developers will be able to build and run Vulkan apps on Apple devices.

Valve, LunarG, and The Brenwill Workshop, members of The Khronos Group consortium that developed Vulkan, have worked together with the Khronos Group Portability Initiative to allow Vulkan apps to be ported to Apple platforms.

vulkanappsmac
The aim of Khronos Group’s Vulkan Portability Initiative is a universal subset of Vulkan 1.0 that is designed to run at native performance levels over Metal and DirectX 12 drivers. Metal and DirectX 12 are able to support almost all of Vulkan, with the exception of elements like triangle fans, separate stencil reference masks, Vulkan Event functionality, and a few other features.

Valve used Vulkan tools on macOS with Dota 2 and was able to achieve "significantly higher performance" than native OpenGL drivers.

vulkandota2
An open source collection of tools, SDKs, and runtime libraries that enable Vulkan development and deployment on macOS and iOS is now available on the Portability Landing Page on the Khronos Group website. With Vulkan support for Mac and iOS devices, developers will be able to support multiple platforms while cutting down on porting and development costs.

"Running Vulkan applications on Apple platforms has been the number one request from developers and today’s release of the MoltenVK runtime and LunarG macOS SDK brings that capability to life,” said Neil Trevett, VP NVIDIA and Khronos Group President. “Developers are invited to download the open source Vulkan Portability tools today and provide feedback via Vulkan Ecosystem GitHub Issue. The Vulkan Portability Initiative will continue to strengthen the infrastructure and tooling around bringing Vulkan capabilities to multiple Metal and DX12 platforms - our long-term goal is to enable portable Vulkan code to be executed on any platform that developers care about."

Starting today, a MoltenVK library from The Brenwill Workshop that translates Vulkan calls into Metal calls on macOS and iOS is being open sourced.

The open source LunarG Vulkan SDK for macOS is also available today on LunarXchange, enabling developers to build, run, and debug Vulkan applications on Mac. Going forward, LunarG plans to continue to evolve its Mac SDK to add additional tools and features.

More information on Vulkan support for Apple devices can be found on The Khronos Group website.

Top Rated Comments

marksatt Avatar
36 months ago
I don’t believe that MoltenVK will be immediately useful to most serious Mac games developers. Aspyr, Feral, Unity and here at Epic we already have direct, native Metal backends that are (or at least should be) faster and support a greater range of features than another intermediate translation library.

Specifically MoltenVK has a list of limitations that make it sufficient for porting mobile Vulkan games and games with a primarily D3D9-era rendering engine, but probably inadequate for most modern D3D11+ game engines.

Principally anything that requires geometry shaders or tessellation shaders is currently not going to work as MoltenVK doesn’t support them. They are *optional* features in Vulkan so it can still call itself conformant by contrast for D3D these are *required* features in D3D11 onward so games do use them, sometimes extensively. Moreover the approach MoltenVK takes to recompiling shaders makes it infeasible to impossible for them to be supported without significant work and performance penalties. Metal doesn’t have direct equivalents so the MoltenVK library would need to defer SPIRV to Metal translation until said shaders are used together in a Shader Pipeline at runtime. Only then could it recompile them to Metal and emulate all the necessary behaviour but this would result in a big performance hit on the CPU. It would also be harder to adopt the native features offered by Mac Metal to deal with these cases and hurt GPU performance.

The other gotcha will be emulating type conversion of data between the resources and the shader. Metal doesn’t have a performant way to do that in all cases right now, so you need to use multiple different techniques to achieve the result while minimising the performance penalty. MoltenVK appears to support only a trivial subset of D3D’s implicit resource type casts which wouldn’t be enough for UE4.

I wish them well in their efforts but this is not going to magically result in better performance in games shipped by Feral, or Epic, etc. It might well end up making it easier for smalller studios with their own engines, esp. mobile focused developers, and that is no bad thing.
Score: 10 Votes (Like | Disagree)
Janichsan Avatar
36 months ago

Does seem like Metal was a step in the right direction, but could be overshadowed by a better standard?

Better? Maybe not, but cross-platform instead of proprietary.
Score: 8 Votes (Like | Disagree)
marksatt Avatar
36 months ago

Why? What would be the issue there? Lacking hardware support on iOS devices?

Mobile GPUs are architecturally *very* different from desktop GPUs so don't have the same features. Metal's API design was predominantly driven by the needs & capabilities of iOS GPUs, hence why geometry shaders are absent and why the tessellation pipeline is completely different to D3D.

Obviously the macOS hardware could support these features in a way that is directly equivalent to D3D and were Apple to do that and developers elected to use said features then those titles would need more work to run on iOS. That being said, it already takes *substantial* effort to rework a macOS title to fit on iOS, as shown by Aspyr's heroic efforts with Civ VI and Feral's equally impressive Rome & GRID ports. Given the difference in performance profile of iOS vs. macOS devices it probably wouldn't really matter as any game that used these features would likely not be viable anyway.
Score: 5 Votes (Like | Disagree)
Rudy69 Avatar
36 months ago

Vulkan, Khronos.. am I seeing a pattern here?

Does seem like Metal was a step in the right direction, but could be overshadowed by a better standard?

Not sure how it's being over shadowed. This is more or less just a tool to take existing Vulkan games and convert the Vulkan calls to Metal calls.
Score: 3 Votes (Like | Disagree)
cube Avatar
36 months ago
Live long and prosper.
Score: 3 Votes (Like | Disagree)
marksatt Avatar
36 months ago

Maybe I'm wrong here, but my understanding is that you do not have to translate the SPIRV shaders to MSL at runtime. MoltenVK apparently comes with a separate conversion tool ('https://www.moltengl.com/docs/readme/moltenvk-readme-user-guide.html') that's supposed to allow you to do this beforehand, and then you can pass your MSL shaders directly to your Vulkan code.



It's surely an extra step during the porting process, but you wouldn't have to deal with the performance hit.

That’s what I said sir, by doing this offline for SPIRV you avoid the runtime performance hit BUT you CANNOT use some/all Metal specific feature and you CANNOT emulate geometry or tessellation shaders. Emulating them requires the full set of shaders in a pipeline so that you can rewrite them to use Metal’s similar but not equivalent features. That is known only at runtime in most engines - not all though. That means combining vertex + (hull and/or geometry) shader stages into compute shaders that must run in an earlier compute command buffer, separate to the later draw call that uses the (domain + pixel shader). Plus all the associated buffer allocations and resource binding shenanigans- it’s actually bloody hard work to get right!
[doublepost=1519686438][/doublepost]

[USER=825783]@marksatt[/USER]

Good to hear some input from someone with good insight. :)

Quite a bit off-topic, but do you know what's going on with the major pauses/lag in between seemingly good frame rates in the MacOS version of Fortnite?

https://www.dropbox.com/s/nzt0h1s9hvrzgad/Fortnite_major_hiccups.m4v?dl=0

Or is the problem I see perhaps related to the NVIDIA Web Driver which is required for the GTX 970 I have to work in MacOS? Sorry, maybe I should report this somewhere else…

Looks like it is either texture streaming or shader compilation or a combination of the two. I’ve explained the challenges of dealing with the initial shader setup at runtime, even with precompiled shaders, elsewhere. It still isn’t a solved problem in UE4 or Fortnite and it likely never will be perfect. This isn’t the forum to report problems - that should be done over at the Fortnite forums and the feedback mechanism ('https://www.epicgames.com/fortnite/forums/bugs-issues/bug-reports').
Score: 3 Votes (Like | Disagree)

Top Stories

0 Deals Hero

Black Friday 2020: Best Apple Deals to Plan For

Saturday November 21, 2020 10:00 am PST by
In the lead-up to Black Friday next week, we've been putting a spotlight on the best deals coming from various retailers like Best Buy and Walmart. In an effort to further prepare our readers for the best Black Friday deals, we're breaking down what we think should be on your radar for Black Friday in 2020. Note: MacRumors is an affiliate partner with some of these vendors. When you click a...
2020 apple shopping event

Apple Offering Up to $150 Gift Card With Select Products on Black Friday Through Cyber Monday

Monday November 23, 2020 2:53 am PST by
Apple has announced its annual four-day shopping event, offering customers up to a $150 Apple Store gift card with the purchase of select products between Black Friday and Cyber Monday in the United States. The gift card values in the United States are as follows: $150 for 16-inch MacBook Pro $150 for 21.5-inch iMac $50 for 13-inch MacBook Pro $50 for MacBook Air $50 for iPhone SE,...
m1 mac mini vignette

Apple Lists M1-Based Mac Mini Logic Boards With 10 Gigabit Ethernet in Internal Parts Ordering System

Friday November 20, 2020 9:32 am PST by
While the new Mac mini with the M1 chip is only available with Gigabit Ethernet, Apple has listed multiple M1-based Mac mini logic boards with 10 Gigabit Ethernet in an internal parts list for Apple Authorized Service Providers. For every Mac mini logic board with Gigabit Ethernet in the parts list, obtained by MacRumors, there is a corresponding logic board with 10 Gigabit Ethernet:...
ipad pro 2020 display

Black Friday Week Kicks Off With Up to $150 Savings on 2020 iPad Pro

Sunday November 22, 2020 2:37 pm PST by
As we head into Black Friday week, we're seeing some of the best deals of the season so far, with Amazon and Best Buy today discounting the latest iPad Pro models by up to $150 at the lowest prices we've ever tracked on these models. Note: MacRumors is an affiliate partner with some of these vendors. When you click a link and make a purchase, we may receive a small payment, which helps us keep ...
macos big sur m1 macs restore issue

Apple Provides Instructions to Fix macOS Reinstallation Errors on M1 Macs

Sunday November 22, 2020 3:30 pm PST by
Shortly after the launch of Apple's new M1 Macs, we saw reports that attempts to restore and reinstall macOS on those machines right away could result in an installation error that would leave your Mac non-functional. Specifically, the error message would read: "An error occurred preparing the update. Failed to personalize the software update. Please try again." Over the weekend, Apple p...
iPhone 6s main

Rumor Claims iOS 15 to Drop Support for iPhone 6s and Original iPhone SE

Sunday November 22, 2020 9:25 am PST by
Apple will drop support for the iPhone SE, iPhone 6s, and iPhone 6s Plus in next year's release of iOS 15, according to a rumor shared today by Israeli site The Verifier. If the rumor is accurate, that would mean iOS 15 will be compatible with the following Apple devices: 2021 iPhone series iPhone 12 Pro Max iPhone 12 Pro iPhone 12 mini iPhone 12 iPhone 11 iPhone 11 Pro iPhone 11 Pro ...
new m1 chip

Craig Federighi: Native Windows on M1 Macs is 'Really up to Microsoft'

Friday November 20, 2020 11:57 am PST by
Following the release of the M1 Macs Apple executives have been doing interviews with a range of publications, and today, Ars Technica published another interview with software engineering chief Craig Federighi, hardware technologies lead Johny Srouji, and marketing VP Greg Joswiak. Much of the interview focuses on topics that the three have already covered in prior discussions, but there is ...
Walmart November Deals Hero

Black Friday Spotlight: Walmart Will Have AirPods Pro Down to Lowest Price of $169, and More Apple Deals

Thursday November 19, 2020 8:05 am PST by
We've been tracking early Black Friday deals in our dedicated Black Friday Roundup, and in an effort to prepare our readers for the big shopping event we're highlighting sales store-by-store in the lead-up to November 27. Note: MacRumors is an affiliate partner with Walmart. When you click a link and make a purchase, we may receive a small payment, which helps us keep the site running. Next ...
xlK6MS4MLqVFaskl

iFixit Shares iPhone 12 Pro Max Teardown Revealing L-Shaped Battery and Bigger Camera Module

Sunday November 22, 2020 2:53 am PST by
In the last of its iPhone 12 series teardowns, iFixit has published its iPhone 12 Pro Max disassembly, which reveals some unique differences in the design of the internals, including the full extent of the larger camera system responsible for the improved low-light performance on Apple's largest iPhone to date. On opening the iPhone 12 Pro Max, the first obvious difference compared to the...
apple leather sleeve

Leather Sleeve for iPhone 12 Models Now Available From Apple

Friday November 20, 2020 12:16 pm PST by
Apple today began selling the Leather Sleeve for the new iPhone 12 models, with the accessory having first been announced alongside the updated iPhones in October. Priced at $129, the Leather Sleeve is not a case and is designed to be removed when the iPhone is in use. It features a cutout at the front that displays the time, and it comes with a matching leather strap. According to Apple, it ...