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.
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.
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
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.
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.
[doublepost=1519686438][/doublepost] 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').