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)

Vulkan Core Concepts

Our goal for this chapter is to implement a simple program that displays a shaded triangle on screen, with the triangle’s vertices and attributes being sourced directly from the shaders. In the process of implementing the code to render this triangle, we will cover most of Vulkan’s fundamental objects, the ones you need to create a very simple application. Although the code required for this minimal example is extensive, the majority of it can be reused and tweaked for other applications. By the end of the chapter, you will know how to bootstrap communication with the driver, how to create and manage basic Vulkan objects, and how to issue rendering commands to the GPU.

In this chapter, following a brief introduction to the Vulkan API, we will cover the following recipes:

  • Calling API functions
  • Learning about Vulkan objects
  • Using Volk to load Vulkan functions and extensions
  • Using Vulkan extensions correctly
  • Using the Validation...