Book Image

The Modern Vulkan Cookbook

By : Preetish Kakkar, Mauricio Maurer
Book Image

The Modern Vulkan Cookbook

By: Preetish Kakkar, Mauricio Maurer

Overview of this book

Vulkan is a graphics API that gives the program total control of the GPU, allowing the GPU to be used to its full potential. This cookbook will uncover useful techniques for emerging new technologies, such as hybrid rendering, extended reality – mixed reality (MR), augmented reality (AR), virtual reality (VR) – and GPU-driven rendering, and even features a dedicated chapter to help you debug and profile your graphics applications with tips and tricks tested in real-world scenarios. The book starts by explaining basic Vulkan concepts while guiding you through the implementation of a basic graphics engine. The building blocks presented in the first few chapters will then help you implement more advanced techniques and algorithms, while getting you acquainted with the inner workings of Vulkan. Gradually, you’ll discover how Vulkan can be used to build hybrid renderers as well as leveraged for the future of graphics with AR/VR/MR. Moreover, you’ll gain an understanding of how it can be debugged or measured for performance. By the end of this book, you’ll be well versed in how to use Vulkan to write graphics applications and how graphics algorithms are implemented using Vulkan.
Table of Contents (12 chapters)

Using Volk to load Vulkan functions and extensions

Volk is an open source library created by Arseny Kapoulkine that provides simple cross-platform support for loading Vulkan functions. The library provides several key features, the most important ones being automatically loading Vulkan’s function pointers and providing cross-platform support.

In this recipe, you will learn how to use Volk to load Vulkan functions and their extensions.

Getting ready

Download Volk from https://github.com/zeux/volk and add volk.c to your project and enable the preprocessor defines for your platform, VK_USE_PLATFORM_WIN32_KHR, VK_USE_PLATFORM_XLIB_KHR, VK_USE_PLATFORM_MACOS_MVK, and so on, before including volk.h.

How to do it…

Volk automatically loads Vulkan’s function pointers, so you don’t have to manually handle the details of loading them and checking for available extensions. If you use Volk in your application, do not link against the static version of...