Version 1.0, updated 2021-11-26
About Vulkan:
There is a lot of information out there on what Vulkan is, it’s history and how it compares to other graphics frameworks. I therefore won’t repeat all that here and instead refer you to the various sources on the web1,2.
So, just as a very brief overview: Vulkan is a 3D graphics and parallel-computing API, similar to DirectX or Metal. Unlike those it is an open standard and designed to be platform-agnostic. It’s main target hardware are GPUs but it is by no means limited to those.
Vulkan differs from it’s older sibling OpenGL in that it is a lower-level abstraction. This means that you have a lot more control over what’s actually happening on the hardware and thus can often achieve higher performance. The price you pay for those advantages is a much more verbose API which you will soon get to know.3
About this tutorial:
You’ll find quite a few tutorials out there on how to get started with Vulkan. However, most of them use its native C-API, others only cover certain aspects or use higer level frameworks. I’m a C++ developer so I would like to be able to use the features that this language has to offer, while still having control and understanding of the fundametal workings. Unfortunately there is relatively little information on the C++ wrapper that comes with the Vulkan SDK. I think that’s a shame because the wrapper is actually pretty good imho. So by writing this tutorial I want to help closing this gap.
You don’t need to have any previous knowledge about Vulkan or any other graphics framework to follow along. However, I won’t go into details about the C++ code itself, so a solid understanding of C++ is recommended. I’ll provide code examples with the most important parts in the text. Additionally there will be a complete, working version of the respective state of the project in the github / bitbucket repositories.
What you’ll need:
The operating system and compiler you use doesn’t really matter for following along. Vulkan should be supported on any reasonably modern computer system with one of the common OSs. I’ll check that my code works on Windows, macos and Linux.
Additionally you’ll need the following tools:
- a C++ compiler toolchain that supports the C++17 standard
- the conan package manager for C++
- CMake.
We’ll cover the system setup process step-by-step in the next chapter
- https://en.wikipedia.org/wiki/Vulkan
- https://www.vulkan.org/
- This is actually pretty similar to C++ compared to higher level languages such as python: you gain control and potentially performance at the cost of convenience