Ok strap yourself in - now we start the journey of implementing our Vulkan rendering system. We will get Vulkan running on all of our target platforms that support it - which is pretty much everything except for Emscripten.
Before we get into the technical swing of things I would strongly recommend learning about Vulkan itself. This is the official site for the Vulkan APIs: https://www.khronos.org/vulkan/.
I had a lot of trouble understanding Vulkan and my fluency with it is still pretty basic. The way I was able to learn about it was from these awesome sites:
By working my way through some of the Vulkan tutorial sites and cross referencing demos in the Github links above, I was able to get Vulkan up and running successfully on my Mac and other platforms. One of the key outcomes I pushed for was to use the Vulkan C++ header instead of the C header, to allow for - in my opinion - a more pleasing coding style and architecture.
The things that I’ll be doing differently to a lot of the online articles I learned from:
internal_ptrfor auto cleanup of resources.
We will be using Vulkan 1.0 because we want to support back to Android 7 Nougat (API-24) which was the first version of Android to ship with Vulkan 1.0 support and additionally the MoltenVK library only maps to Vulkan 1.0 (at least at the time of writing these articles that was the case), so we want to be as backward compatible as we can.
Our Emscripten platform won’t be able to use Vulkan as it is limited to WebGL, though in the future it might be possible using libraries such as ANGLE.
As we did with the OpenGL based articles, we’ll begin by writing as much automated setup scripts to bootstrap the target platforms to use Vulkan, followed by the actual usage of the Vulkan SDK itself.
We have already written quite a lot of the core foundation for our engine so the good news is that we won’t take as long to get to the rendering code this time - though brace yourself there is far more rendering code for Vulkan!
Running Vulkan applications has a few extra constraints compared to OpenGL:
End of part 13