mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-22 07:24:34 +00:00
Vulkan Bootstrapping Iibrary
39a3c37465
Now there is a concise example of the library in use all the way to presenting. Needs to be rewritten to remove exceptions, but for first pass its good enough. |
||
---|---|---|
ext | ||
src | ||
tests | ||
.clang-format | ||
.gitignore | ||
.gitmodules | ||
CMakeLists.txt | ||
LICENSE.txt | ||
README.md |
Vk-Bootstrap
A Vulkan Utility library meant to jump start a Vulkan Application
This library simplifies the tedious process of:
- Instance Creation
- Physical Device Selection
- Device Creation
- Getting Queues
- Swapchain Creation
Example
vkb::InstanceBuilder builder;
builder.setup_validation_layers()
.set_app_name ("example")
.set_default_debug_messenger ();
auto inst_ret = builder.build ();
vkb::Instance inst;
if (inst_ret.has_value()) {
// successfully created instance
inst = inst_ret.value();
}
vkb::PhysicalDeviceSelector(inst);
selector.set_surface (/* from user created window*/)
.set_minimum_version (1, 0)
.require_dedicated_transfer_queue();
auto phys_ret = selector.select ();
vkb::PhysicalDevice phys;
if (phys_ret.has_value()) {
// successfully selected a sufficient physical device
phys = phys_ret.value();
}
vkb::DeviceBuilder device_builder(phys_dev);
auto dev_ret = device_builder.build ();
if(dev_ret.has_value()){
// successfully created a vulkan device
}
Building
Requires CMake and Vulkan installed on your system.
git clone https://github.com/charles-lunarg/vk-bootstrap
cd vk-bootstrap
mkdir build
cd build
cmake ..
To test, glfw and Catch2 are used and automatically included using git submodules.
In the project directory, run
git submodule update --init
to get the required dependencies for testing setup.
Then return to the build directory and enable tests with VK_BOOTSTRAP_TEST
cmake ../path/to/vk-bootstrap/ -DVK_BOOTSTRAP_TEST=ON