Repolode
KhronosGroup

KhronosGroup/Vulkan-Hpp

Header-only C++ bindings for the Vulkan C API, adding type-safe enums, STL support, exceptions and RAII handles.

Stars
3,818
Forks
374
Open issues
29
Last commit
3 days ago

What is it?

Vulkan-Hpp is a header-only C++ wrapper around the Vulkan C API. It aims to make Vulkan code easier to write in C++ without adding run-time CPU overhead. The bindings add type safety for enumerations and bit-fields, STL container support, exception-based error handling, and several flavours of RAII-capable handle types.

The repository holds the generators that read the Vulkan XML specification and emit the C++ headers. Documentation covers building and regenerating the headers, usage examples, configuration macros, and the three handle families that offer unique_ptr-like, shared_ptr-like and vk::raii semantics. The C API's configuration macros remain available.

The headers ship with the LunarG Vulkan SDK and the Khronos Vulkan-Headers repository, and are packaged for vcpkg and Conan. Continuous integration tests GCC, Clang and MSVC on Windows, Linux and macOS (via MoltenVK).

Key features

  • 01Header-only, with no separate library to link
  • 02Type-safe enumerations and bit-fields
  • 03STL container support and exception-based error handling
  • 04Several RAII handle families, including vk::raii
  • 05Headers generated from the official Vulkan XML specification
  • 06Available through the Vulkan SDK, vcpkg and Conan

Use cases

  • Writing Vulkan renderers or compute code in modern C++
  • Reducing boilerplate and manual resource cleanup in Vulkan applications
  • Building Vulkan projects with C++ modules using the named vulkan module

Quick start

  1. 1

    Install Vulkan-Hpp via vcpkg: clone the vcpkg repository

    git clone https://github.com/Microsoft/vcpkg.git
  2. 2

    Bootstrap vcpkg from its directory

    cd vcpkg && ./bootstrap-vcpkg.sh
  3. 3

    Install the vulkan-headers port, which includes Vulkan-Hpp

    ./vcpkg install vulkan-headers

Things to know

  • Requires a C++ compiler with C++ modules or recent C++ standard support, depending on the features used.
  • The LunarG Vulkan SDK is the recommended install route, so standalone use may need extra setup.

In collections

Topics

FAQ

What is Vulkan-Hpp?
Header-only C++ bindings for the Vulkan C API, adding type-safe enums, STL support, exceptions and RAII handles. Vulkan-Hpp is a header-only C++ wrapper around the Vulkan C API. It aims to make Vulkan code easier to write in C++ without adding run-time CPU overhead. The bindings add type safety for enumerations and bit-fields, STL container support, exception-based error handling, and several flavours of RAII-capable handle types.
Is Vulkan-Hpp free to use? What license does it have?
Vulkan-Hpp is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is Vulkan-Hpp still maintained?
Actively maintained. The last commit to Vulkan-Hpp was on Nov 4, 2026.
What can I use Vulkan-Hpp for?
Writing Vulkan renderers or compute code in modern C++ Reducing boilerplate and manual resource cleanup in Vulkan applications Building Vulkan projects with C++ modules using the named vulkan module
How do I install Vulkan-Hpp?
Install Vulkan-Hpp via vcpkg: clone the vcpkg repository: git clone https://github.com/Microsoft/vcpkg.git Bootstrap vcpkg from its directory: cd vcpkg && ./bootstrap-vcpkg.sh Install the vulkan-headers port, which includes Vulkan-Hpp: ./vcpkg install vulkan-headers
Where can I get Vulkan-Hpp?
The source code and installation instructions are on GitHub: https://github.com/KhronosGroup/Vulkan-Hpp

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects