explaingit

khronosgroup/moltenvk

5,621Objective-C++Audience · developerComplexity · 4/5Setup · hard

TLDR

A compatibility layer that translates Vulkan graphics API calls into Apple's Metal API, letting Vulkan-based games and 3D apps run on macOS, iOS, tvOS, and visionOS without being rewritten for Apple hardware.

Mindmap

mindmap
  root((MoltenVK))
    What it does
      Translates Vulkan to Metal
      Converts SPIR-V shaders
      Enables App Store apps
    Platforms
      macOS
      iOS and tvOS
      visionOS
    Tech Stack
      Objective-C++
      Vulkan 1.4
      Metal API
    Setup
      LunarG Vulkan SDK
      Xcode 15 plus
      CMake and Python
    Audience
      Game developers
      Graphics engineers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run a Vulkan-based game or 3D app on macOS or iOS without rewriting it for Apple's Metal API.

USE CASE 2

Convert SPIR-V shaders to Metal Shading Language offline during your build process using MoltenVKShaderConverter.

USE CASE 3

Distribute a Vulkan app through the Apple App Store, since MoltenVK uses only publicly documented Apple APIs.

USE CASE 4

Add Apple platform support to a cross-platform Vulkan game engine with minimal code changes.

Tech stack

Objective-C++VulkanMetalSPIR-VCMakePythonXcode

Getting it running

Difficulty · hard Time to first run · 1h+

Requires Xcode 15 or later plus CMake and Python, iOS/tvOS/visionOS targets need a fetch script to download and compile external dependencies.

No license information is mentioned in the explanation.

In plain English

MoltenVK is a compatibility layer that lets software written for Vulkan, a widely used graphics and compute standard, run on Apple devices. Vulkan is a low-level API for controlling graphics hardware directly, popular for games and 3D applications, but Apple does not support it natively. Instead, Apple hardware uses a graphics system called Metal. MoltenVK sits between the two, translating Vulkan instructions into Metal equivalents so Vulkan-based applications can run on macOS, iOS, tvOS, and visionOS without being rewritten. One part of the translation involves shaders, which are small programs that run directly on the graphics chip. Vulkan uses a format called SPIR-V for shaders. Metal uses its own format called Metal Shading Language. MoltenVK automatically converts SPIR-V shaders to Metal Shading Language at runtime, so developers do not need to maintain separate shader code for Apple platforms. MoltenVK implements a large subset of Vulkan 1.4 and uses only Apple publicly documented APIs. Because it avoids private or undocumented calls, applications using MoltenVK are compatible with Apple App Store distribution rules. The library ships in two parts: the runtime library that handles translation on the fly, and a standalone command-line tool called MoltenVKShaderConverter for converting shaders offline during development. Developers can access pre-built binary releases directly from the repository without building from source. For macOS development, the recommended setup is through the Vulkan SDK from LunarG, which bundles a MoltenVK build. For iOS, tvOS, or visionOS targets, developers clone the repository, install cmake and Python, and run a fetch script that downloads and compiles external dependencies. Building requires Xcode 15 or later. The project is maintained by the Khronos Group, the industry consortium that owns the Vulkan standard.

Copy-paste prompts

Prompt 1
I have a cross-platform Vulkan game engine. Show me how to integrate MoltenVK so it runs on macOS, including the CMake changes and any Vulkan instance creation adjustments needed.
Prompt 2
Walk me through using MoltenVKShaderConverter to convert a SPIR-V shader binary to Metal Shading Language as part of a CI build pipeline.
Prompt 3
My Vulkan app uses an extension that MoltenVK does not fully support. How do I check MoltenVK feature support at runtime and add a fallback code path?
Prompt 4
Set up a fresh Xcode project that builds a Vulkan iOS app using the MoltenVK library, including the fetchDependencies step.
Open on GitHub → Explain another repo

← khronosgroup on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.