Why I decided to adopt Vulkan

I had to decide the graphics library for the 3D rendering part of my framework, and I decided to adopt Vulkan for a series of reasons. First of all, after years of experience with OpenGL library, I decided that the trend of adding extensions is not good for the maintenance of the software. You may say that there are many wrappers around and you don't have to care about the underlying library, but it's not a good practice at all.

Vulkan (API) - Wikipedia

You are going to add an external dependency on your software, you don't have control over it and as a programmer, you are not going to learn anything (apart the wrapper itself). I programmed several OpenGL applications without using any wrapper and it's the best thing to do. In this way, you learn how the library works and all the issues related to that. One of the worst is the huge quantity of extensions. If you are lucky, the OpenGL version that you are targetting already has all the extensions that you need to use, so you don't need to check them one by one for the functionality that you are supporting, but just the OpenGL version. However, the target version always depends on what you need to do. If you want to support OpenGL 4.5, you need to know if all the GPUs that you want to support have that particular version of OpenGL. One day you could find that OpenGL 4.5 is not supported on a particular hardware and that your engine is not so good from a scalability point of view. Falling back to older OpenGL versions may require an entire refactor of the engine, that is not so nice if you had to release for tomorrow. On the contrary, if you need to support older versions of OpenGL from 3.0 onward, you will experiment on your person how hellish could be to deal with the outstanding amount of extensions that the library has just to support the most basic things. And anyway, this is not even the main problem. Even if you drop the past, you cannot prevent the GPUs vendors and the Khronos group from releasing extensions in the future that will be required to have decent performance on modern hardware, because the entire OpenGL architecture is obsolete.

Vulkan is a totally different world. It has been designed around modern features like shaders, UBOs and command buffers. The only extensions that you need to check are required to run on different platforms or to solve some other minor issue, but they are very few. The only thing that discourages most of the programmers to adopt it instead of OpenGL is the complexity, but it's a false myth. If drawing a single triangle may sound tricky if you are programming Vulkan for the first time, after that you will find the other stuff very easy to do. The most important thing is not to use wrappers or other libraries built on top of Vulkan or to build your software around other examples that you may find on the web: just write your own engine from scratch, it's the best thing you can do. Another concept that is misleading around Vulkan is that you can only do a limited set of things, like a small number of descriptor sets coming from the same descriptor pool, with few uniform buffers whose content should be accessed only with push constants by several draw commands, that is false. With Vulkan you can do the same things that you can do with the other libraries, then you can decide what kind of optimization is the best for your specific case. If you need to setup N draw commands with N uniform buffers and N descriptor sets, you absolutely can do it, you can create a descriptor pool with maxSets to N and then use it, if required. If N is too large and the buffers are too small, just optimize it with larger buffers and less descriptor sets. There is a big misconception of what is a limit and what is an optimization, what can be done in real-time and what can be precalculated.

For sure, with OpenGL you can get the first wrapper around, create a context and draw your triangles in few minutes, while with Vulkan it may require days or weeks. But the positive is that you are starting with a fresh library that has been designed around modern concepts instead of workarounds to make it survive and more importantly, you have more freedom for your optimizations. That's the reason why I decided to adopt Vulkan.