Vulkan Bootstrapping Iibrary
Go to file
Charles Giessen 83d58fc6d4 Fixed example in readme, made transfer/compute queue selection find a distinct queue,
removed uncessary private members in vkb::Instance, and removed superfluous comment headers
2020-02-17 13:13:09 -07:00
example Finished basic rewrite of queue handling logic 2020-02-10 18:01:58 -07:00
ext Added glfw as git submodule + Catch2 2020-01-30 01:47:41 -07:00
src Fixed example in readme, made transfer/compute queue selection find a distinct queue, 2020-02-17 13:13:09 -07:00
tests Replaced std::string with const char * 2020-02-11 17:51:03 -07:00
.clang-format modified clang format again 2020-02-06 17:42:10 -07:00
.gitignore First commit of Vk-Bootstrap 2020-01-30 01:20:18 -07:00
.gitmodules Added glfw as git submodule + Catch2 2020-01-30 01:47:41 -07:00
CMakeLists.txt moved triangle.cpp to its own folder, updated readme & license 2020-02-03 20:34:46 -07:00
LICENSE.txt moved triangle.cpp to its own folder, updated readme & license 2020-02-03 20:34:46 -07:00
README.md Fixed example in readme, made transfer/compute queue selection find a distinct queue, 2020-02-17 13:13:09 -07:00

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

It also adds several conveniences for:

  • enabling validation layers
  • setting up a debug callback
  • selecting a gpu based on a small set of common criteria

Example


#include "VkBootstrap.h"

void device_init()
{
    vkb::InstanceBuilder builder;
    builder.setup_validation_layers()
           .set_app_name ("example")
           .set_default_debug_messenger ();
    auto inst_ret = builder.build();
    if (!inst_ret.has_value()) {
        // error
    }
    vkb::Instance inst = inst_ret.value();

    vkb::PhysicalDeviceSelector selector{ inst };
    selector.set_surface (/* from user created window*/)
            .set_minimum_version (1, 0)
            .require_dedicated_transfer_queue();
    auto phys_ret = selector.select ();
    if (!phys_ret.has_value()) {
        // error
    }
    vkb::PhysicalDevice physical_device = phys_ret.value();

    vkb::DeviceBuilder device_builder{ physical_device };
    auto dev_ret = device_builder.build ();
    if (!dev_ret.has_value()){
        // error
    }
    vkb::Device device = dev_ret.value();

    auto graphics_queue_ret = get_graphics_queue(device).value();
    if (!graphics_queue_ret.has_value()){
        //error
    }
    VkQueue graphics_queue = graphics_queue_ret.value();
}

Using this library

Simple

Copy the src/VkBootstrap.h and src/VkBootstrap.cpp into your project

With git-submodule + CMake

add this project as a git-submodule

git submodule add https://github.com/charles-lunarg/vk-bootstrap

Then add the project with cmake

add_subdirectory(vk-bootstrap)

Manually Building

git clone https://github.com/charles-lunarg/vk-bootstrap
cd vk-bootstrap
mkdir build
cd build
cmake ..

To test, glfw and Catch2 are needed 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

Todo's

  • Package library to be usable
  • More examples
  • Testing
  • Documenting API
  • Fleshing out device configuration