Chapter -1: about this series
This series is a work in progress
What it is
An overview of GPU programming with Vulkan for computational and graphical purposes.
Each chapter contains two parts:
- A concise, high-level overview of the topic at hand, meant to provide a mental model of the API
- A more detailed coverage of the same topic, focusing on how these concepts are concretely implemented in the API
What it is not
- A step-by-step guide to implementing a rendering engine
- A collection of concrete examples
- A guide to the lovely math behind computer graphics
In fact, this series is almost free of code samples, as I feel that these would needlessly bloat the articles: Vulkan is very verbose (reflecting the complexity of modern GPUs), and writing the code is not the hard part. I wanted to leave center stage to conceptual understanding, as opposed to pedestrian implementation concerns. Samples can easily be found online.
Prerequisites
Knowing how to read and program.
Why not read X or Y instead?
I have been working on Batyr on-and-off for the past few years (2% of the time on and the remaining 98% off), and I have had the time to forget everything about Vulkan a few times by now. Getting back in the saddle is unpleasant — most guides are too focused on specific workloads or verbose for my liking (I cannot see how the pieces fit together if everything is spread over 40 different pages), and the doc is too terse (as a good doc should be). This guide aims for a sweet spot. As outlined above, each chapter follows a split structure: the big ideas of a chapter are introduced in isolation before being fleshed out in a second part. This approach brings the following advantages:
- The big ideas are effectively repeated twice (repetitio est mater studiorum[?], as they say, although practice is of course required to truly anchor these ideas).
- The high-level overviews ensure that a quick and easily digestible refresher is always some scrolling away if brain fog starts to settle in.
- More generally, reading only the first part of each chapter is an efficient way of refreshing one's mental model of Vulkan.
A pecularity of this guide is that it introduces Vulkan as a general library for interacting with GPUs (straying away from the usual focus on graphics programming). This offers two key benefits: other Vulkan functionalities are not presented as if they were afterthoughts, and it makes it possible to introduce the API's complexity in a staggered manner. By the time we get to the graphics pipeline, most involved concepts should feel familiar.
With that being said, if you heard good things about X or Y, by all means, do use them! Using a variety of sources is probably the best thing you could do. If no one talked to you about any X nor Y, I listed some personal recommendations below.
Some good alternatives/complementary sources
- https://www.vulkan.org/learn
- https://docs.vulkan.org/guide/latest/index.html
- https://registry.khronos.org/vulkan/specs/1.3-extensions/html/
- https://vkguide.dev
- https://renderdoc.org/vulkan-in-30-minutes.html
- https://github.com/KhronosGroup/Vulkan-Samples
- https://vulkan-tutorial.com/
- https://alain.xyz/blog/comparison-of-modern-graphics-apis
Caveat
May Will contain mistakes, I am not a pro. Also, this series could do with more
illustrations — right now it is mostly big walls of text (I might come back to fix this at
some point).