AndPlus acquired by expert technology adviser and managed service provider, Ensono. Read the full announcement

Vulkan Is Coming to MacOS and iOS

Apr 18, 2018 9:05:00 AM

shutterstock_330841604-1 medIn ancient Roman mythology, Vulcan was the god of fire and metal smithery. It’s from his name that we get the word “volcano.” Much later, in Star Trek lore, Vulcan was the home planet of First Officer Spock of the starship Enterprise.

How any of this leads to the name (with variant spelling) of a 3D graphics API is anyone’s guess, but there it is: Vulkan has been, since 2016, an open-source, cross-platform API for rendering 3D graphics for video games, computer-aided design (CAD) software, and other 3D graphics-intensive applications. Its development is managed by the non-profit Khronos Group, which is supported by graphics hardware manufacturers, game development companies, and tech heavyweights such as Google.

Vulkan vs. OpenGL

Vulkan was designed as an alternative to the older OpenGL API (also managed by the Khronos Group). For most applications, Vulkan has some important advantages over OpenGL:

  • Vulkan offers more efficient and more balanced assignment of work between the device’s CPU and graphics processing unit (GPU), and can divide work among multiple CPU cores, or among the GPUs in the multiple-GPU environments that are becoming more common in gaming PCs and consoles.
  • Compared with OpenGL, Vulkan reduces the CPU workload, which is especially important on mobile devices that have limited power resources.
  • As a lower-level API, Vulkan offers developers greater control over GPU coordination and memory management.

That said, OpenGL is still a popular choice for some applications, in large part because it’s less complex from a code development and maintenance standpoint, and may be the better choice when performance is less critical.

All the Cool Kids Are Doing It, Except…

Because of its advantages, Vulkan is supported on nearly every major platform, including Windows, Android, Linux, Nintendo Switch, and Samsung’s Tizen mobile OS.

Conspicuously absent from that list are Apple’s platforms, macOS and iOS.

The reasons are unclear, but Apple has steadfastly refused to add support for Vulkan to its operating systems. MacOS supports only an older and slower version of OpenGL, and iOS supports OpenGL ES, a version designed for mobile operating systems. Developers have had to maintain separate graphics rendering codebases in order to make software products available on all platforms.

In an increasingly cross-platform-friendly world, this kind of thing drives developers batty.

Bridging the Gap: MoltenVK

Fortunately, when the going gets tough, the tough develop workarounds. Canada’s Brenwill Workshop Ltd. has developed a product called MoltenVK, using Apple’s Metal graphics framework, to enable developers to use their Vulkan code in software for macOS and iOS. Brenwill Workshop has made MoltenVK available as a free, open-source project on GitHub.

MoltenVK was designed to be lightweight, so as to impact performance as little as possible. To do that, the developers had to leave out some of Vulkan’s native features; still, it offers nearly complete Vulkan support, and most applications will see little or no impact from the missing features.

MoltenVK represents a huge benefit for developers:

  • Only one graphics codebase is needed for a given software product
  • Developers don’t need to learn yet another graphics API
  • Performance won’t suffer

All this, and it’s an open-source solution, too. It’s a developer’s dream come true.

Well, almost. It would be really nice if Apple would support Vulkan directly, and remove the need for this kind of workaround. But developers will take what they can get. The macOS/iOS market is way too large to ignore, so if a workaround is what it takes to reach them, then so be it.

Will Apple eventually provide support in macOS and iOS for Vulkan? It’s hard to tell—Apple traditionally has preferred to keep tight control over its hardware and the software that runs on it, but it would seem to be in their best interest to enable a performance-enhancing technology such as Vulkan on their devices. Eventual Vulkan support may be the reason Brenwill Workshop released MoltenVK as an open-source project—they don’t want to commit a lot of in-house resources to ongoing maintenance of something that might not be needed for long.

In the meantime, MoltenVK fills an urgent need for game developers and others who want to tap the crucial Apple market without a bunch of extra work. It will help them, to paraphrase Mr. Spock, to live long and prosper.

Brian Geary

Written by Brian Geary

Brian is a true believer in the Agile process. He often assists the development process by performing the product owner role. In addition to his technical background, he is an experienced account manager with a background in design and marketing.

Get in touch