Vulkan
I haven’t posted in quite some time, as a couple weeks ago, I decided to learn Vulkan, the new, low-overhead graphics API developed by Khronos. The reasons for which I want to learn this are :
-
it can offer potentially great performance if used correctly
-
it allows me to understand how things work at a lower level, which is what I am really interested about
-
I started getting a bit tired of OpenGL if I’m completely honest…
Issues…
Vulkan, being a low-overhead API (which seems to be the new trend when it comes to modern graphics APIs like Metal, DirectX12…). The problem with this, is that writing vulkan code takes forever. To draw a triangle in OpenGL, it would take around 300 lines max (if using modern OpenGL - shaders…). In Vulkan, it takes 1200 lines.
Why?
Because in Vulkan, everything has to be done by the user manually : instance, physical device, logical device, queues, surface, swapchain, render passes, descriptor sets and layouts, graphics pipelines, buffers, semaphores, fences……..
The thing that surprised (and confused) me when learning Vulkan was all the synchronisation primitives that are available. I couldn’t quite understand the difference between semaphores and fences (appparently there is also something called an event but I never had to work with that yet). From what I understand currently, semaphores make sure the commands sent to the GPU do not overlap (because yes, in the same queue, commands can overlap). Fences allow the user to halt command submission (on the CPU side) until a certain point, until another command finished. There are also memory barriers which basically signal a memory dependency - make sure that a command that might relie on some memory, only executes when another finishes doing stuff to that piece of memory (I will need to do more reading on these primitives).
What am I doing at the moment?
I am currently building a Vulkan framework for me to use for the game that I am currently working on. When I make sufficient progress on the actual Vulkan framework, I will start maybe posting about the game. (the link to the project : https://github.com/llGuy/graphics/tree/master/vulkan_test)
However, my development may seem extremely slow. This is simply because of school and exams. I may try to fit some programming at least once a day, however, this is starting to be difficult…
What have I been reading about other than Vulkan?
I’ve been extremely interested in programming design and read a lot about object-oriented programming, its negative effects, its positive effects. I’ve read articles and watched videos from my current favorite game developers : Jonathan Blow and Casey Muratori (even though he may be particularly and passionately against OOP), as compression-oriented (as Casey puts it), data-oriented and exploration-based programming both seem extremely interesting to me… I am currently exploring these philosophies through this engine, as before, I’ve programmed in the traditional OOP way. I guess I’m trying something new…