3 ms·
Do the following: <start a timer> vi vulkan_one_pixel.cpp <add the required code to open a window and draw *one* pixel> <save, compile, debu
by ur-whale 5y ago
Do the following:
<start a timer>
vi vulkan_one_pixel.cpp
<add the required code to open a window and draw *one* pixel>
<save, compile, debug, rinse, repeat until a window is opened and a pixel is drawn in it>
<stop timer>
<read timer>
wc -l vulkan_one_pixel.cpp
du -sh vulkan_one_pixel.cpp
<despair>
- skocznymroczny 5y agoVulkan has a very high initial cost when it comes to lines of code. You have to recreate a lot of stuff that you took for granted in OpenGL, such as a default framebuffer to draw to. Also, a lot of boilerplate code to create resources can be abstracted away into functions to reuse later. So while you might need a lot of lines to even draw a triangle, you won't need many more lines to draw a full 3D model.
- Jhsto 5y agoFor anyone interested in the Vulkan end of things, I recommend this: https://hoj-senna.github.io/ashen-aetna/ https://hoj-senna.github.io/ashen-aetna/ What is nice to see that with Rust's linearity, cleaning resources once they become unused can be cleared quite easily by implementing a custom drop function. The challenge remains though that to know what order you have to do it requires consultation of the Vulkan specification. Though even for this you can enable Vulkan validation layers which actually give quite clear idea what you are doing wrong.