r/GraphicsProgramming • u/XAstrixsmX • 19h ago
Looking for feedback on my Vulkan renderer before I go further
I’ve been working on a small Vulkan renderer mainly as a learning project and was wondering if anyone had some time to look over it and give me feedback on the overall structure and design.
I started with the Vulkan in 2 Hours video, and after working through that I felt like I picked up how the API worked pretty quickly. From there I started pulling parts out of the original setup and building my own renderer API around them instead of keeping everything directly inside Application.cpp.
Right now I have things like the renderer context, swapchain, shaders, pipelines, descriptors, images and textures, samplers, materials, mesh loading, dynamic rendering, a geometry pass, and a skybox/environment map working.
The hardest part for me so far has probably been understanding queues, queue families, command pools, command buffers, and the overall frame lifecycle. I feel like I understand most of the individual pieces, but figuring out how they should all fit together cleanly has been more difficult than things like pipelines, descriptors, or basic rendering.
Before I start getting into compute shaders, more rendering passes, async compute, and eventually a render graph, I wanted to stop for a bit and make sure I’m not building on top of a bad foundation.
The main thing I’ve noticed is that the public-facing side of the renderer, especially what you see in Application.hpp/.cpp, is starting to feel a little too verbose.
Texture and image creation is probably where I notice it the most. There are a lot of specifications, image views, descriptor registrations, layouts, barriers, and other Vulkan details being handled by the caller. I know Vulkan is supposed to be explicit, and I don’t want to hide everything behind huge abstractions, but I’m not really sure where the line should be between giving the user control and keeping implementation details inside the renderer.
I’m also wondering about the overall structure of the project. Things like resource ownership, descriptor handling, pipeline setup, pass setup, queue and command buffer ownership, frame lifecycle, and how much Vulkan should really be exposed through the higher-level API.
My current plan is to eventually add a SceneRenderer that handles scene rendering and pass submission, then later add a render graph to handle things like resource dependencies, barriers, layouts, and pass ordering. I’d also like to experiment with async compute once I get to that point.
I’m still learning C++ and graphics programming while working on this, so I’m mostly trying to catch bad design choices early before the project gets much bigger.
If anyone has time to look through it, I’d really appreciate feedback on things like:
- Whether the current abstractions make sense
- What parts of the API feel too verbose
- What responsibilities should probably move out of
Application - Whether the image and texture API should be higher level
- Whether my queue, command pool, command buffer, and frame lifecycle setup makes sense
- Anything I’m doing now that might make a render graph or multiple passes harder later
- General C++ or Vulkan design problems that stand out
I’m not expecting anyone to do a full code review. Even just looking through a few of the renderer files and pointing out anything that looks awkward or could be structured better would help a lot.
Project: https://github.com/AstrixsmCS/VkLab
Thanks.
2
u/S48GS 18h ago
https://howtovulkan.com/#queues
use Vulkan 1.3+ with bindless pipeline - link to modern tutorial above