Activity

Pheen

I had to take a break because of school and stuff but I am back and the rectangle now inhibits a 3d view 🎉. To do this we need to share a model-view-matrix with the shader. This is done in Vulkan with the help of resource descriptors. A descriptor is a way for shaders to freely access resources like buffers and images.

Resources used:

0
Pheen

I know that at this point the pride triangle was a bit boring, so introducing the new and improved pride rectangle.
A few things have changed, g.e. I moved the renderer into a different class, implemented vertex buffers -> from now on you don’t have to specify the vertices inside the shader file, and I implemented the index buffer (no more duplicated vertices, see image below)

Attachment
Attachment
0
Pheen

I refactored the code again so that the Vulkan structs use designated initialisation (see image below), and added const and constexpr where applicable.

Attachment
0
Pheen

rewrote the slang(shader) compilation in python instead of CMake because **** CMake

Attachment
0
Pheen

So I added implemented swap chain recreation. This makes everything scale properly when resizing the window at runtime.

0
Pheen

So again nothing crazy - I just added an option to render multiple frames without needing to wait for each frame to be presented on the screen. This basically allows the host(essentially the CPU) to queue up more work while the device(GPU) is still processing previous frames, meaning less unnecessary idle time on the host. (This explanation is oversimplified and probably wrong, but I didn’t want to copy paste some graphics programming mumbo jumbo)

Attachment
1

Comments

Dark System
Dark System 2 months ago

Very cool! Vulkan is a bit of a pain to deal with, so congrats on building an engine!

Pheen

So for now I haven’t done anything crazy refactored the code and put the vulkan initialisation in its own file. Also just a heads up. If anyone is considering using vulkan, just use a library like vk-bootstrap(https://github.com/charles-lunarg/vk-bootstrap) so you don’t have to write 500+ lines of code just for initialisation.

Attachment
0
Pheen

Found it. Hopefully from now on I can be more consistent with devlogs

Attachment
0
Pheen

Took a like a dozen hours to get it to work but here we go, a window. Now where is that damn triangle.

Attachment
0