vkw - Vulkan API Wrapper. It is lightweight C++ wrapper over Vulkan library. This project is work in progress.
- Compiler: gcc 12.0+ / msvc 19.44 (core c++20 minimum)
- CMake: 3.30+
- Boost: 1.80+
- Python 3.10+
- Vulkan SDK 1.4.328+: https://vulkan.lunarg.com/
Older versions of components may work, but are not tested with.
First, install all dependencies listed above.
git clone https://github.com/FixPlus/vkw.git --recursive
cd vkw
cmake -B build -S .
cmake --build build
cmake --install buildOpen it as a cmake project and follow instructions from your IDE.
Use find package
find_package(vkw <version>)Link your project to it:
target_link_libraries(<target name> PUBLIC vkw::vkwrt)API is divided in a few headers, you can include what you need and use:
#include <vkw/Library.hpp>
int main(){
auto lib = vkw::Library();
std::cout << "Loaded vulkan: " << lib.instanceAPIVersion() << "\n";
}- No hard linking to system vulkan loader (just like in volk). Symbols are fetched according to requested API version. Drivers symbols are fetched directly from driver, skipping instance level dispatch. Extensions and layer's symbols are fetched automatically when used.
- All objects are wrapped in unique_ptr like structures that manage objects' lifetime.
- Vulkan countless structure filling routines are wrapped into methods with easy api.
- Although this library encapsulates many manual work with Vulkan C API, it still exposes it for users to extend current implementation by writing new derived classes and methods using C API.
- Tools for linking and inspecting spirv shader modules are included in this library api, allowing to build and manage shader libraries.
- Majority of this library's code is c-plus-plus headers, however some functionality requires to be wrapped into shared library. It's binary interface is full C ABI and it can be safely re-used and distributed.