moltenvk
by
khronosgroup

Description: MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.

View khronosgroup/moltenvk on GitHub ↗

Summary Information

Updated 2 hours ago
Added to GitGenius on August 31st, 2025
Created on November 7th, 2017
Open Issues/Pull Requests: 310 (+0)
Number of forks: 474
Total Stargazers: 5,507 (+0)
Total Subscribers: 131 (+0)
Detailed Description

MoltenVK is an open-source, Apple-developed implementation of the Vulkan graphics and compute API on top of Metal, Apple’s native graphics framework. Essentially, it’s a translation layer allowing Vulkan applications to run on Apple platforms (macOS, iOS, tvOS, and visionOS) without requiring native Metal code. The repository at https://github.com/khronosgroup/moltenvk houses the source code, build instructions, and related documentation for this crucial compatibility layer.

The primary goal of MoltenVK is to enable cross-platform game and application development. Vulkan is a widely adopted API known for its low overhead and explicit control over the GPU, making it popular for performance-critical applications. Before MoltenVK, porting Vulkan applications to Apple platforms required a complete rewrite using Metal, a significant undertaking. MoltenVK drastically reduces this porting effort, allowing developers to leverage existing Vulkan codebases and target Apple’s ecosystem with relative ease. It’s important to note that MoltenVK doesn’t *emulate* Vulkan; it *translates* Vulkan commands into equivalent Metal operations, aiming for performance as close to native Metal as possible.

The repository’s structure reflects this translation focus. Key components include a Vulkan loader, which intercepts Vulkan API calls, and a Metal backend, which handles the actual execution on the GPU via Metal. The loader maps Vulkan objects and functions to their Metal counterparts, managing resource allocation and synchronization. A significant portion of the code is dedicated to handling the differences between the two APIs, such as memory management, shader compilation, and pipeline state objects. The repository also includes extensive validation layers, crucial for debugging and ensuring Vulkan applications behave correctly when translated through MoltenVK. These layers help identify potential issues arising from API misuse or translation discrepancies.

The project is actively maintained by Apple engineers and benefits from contributions from the wider open-source community. The repository contains detailed build instructions for various platforms and configurations, including support for CMake. It also provides comprehensive documentation, including API reference, design documents, and troubleshooting guides. Regular updates address bug fixes, performance improvements, and compatibility with new Vulkan specifications and Apple operating system releases. The repository’s issue tracker is a valuable resource for reporting bugs, requesting features, and engaging with the development team.

Beyond the core translation layer, MoltenVK includes tools for shader compilation and debugging. It leverages the Metal shader compiler to translate GLSL (OpenGL Shading Language) or HLSL (High-Level Shading Language) shaders, commonly used in Vulkan applications, into Metal Shading Language (MSL). This ensures that shaders are optimized for Apple’s GPUs. The repository also provides integration with debugging tools like Xcode, allowing developers to step through Vulkan code and inspect GPU state. In essence, MoltenVK is a sophisticated and continually evolving project that bridges the gap between the Vulkan and Metal ecosystems, fostering cross-platform development and expanding the reach of Vulkan applications to Apple’s platforms.

moltenvk
by
khronosgroupkhronosgroup/moltenvk

Repository Details

Fetching additional details & charts...