I am writing this nearly 2 weeks after my last devlog. I initially had planned to spend a week fleshing out my Breakout game, and then move on to creating another retro game. I added some more blocks to it, and then decided to move on to making Pong on my own. I got as far as the initial gameplay loop without score, and then decided to start investigating wgpu. wgpu is a Rust implementation of the WebGPU API spec, to allow for web code access to GPU functions. It then translates down to whatever API the hardware is using. The API is laid out similarly to Vulkan, however it abstracts away a lot of the nitty gritty details that Vulkan is known to expose.

wgpu

This is as far as I got with wgpu. I had a mesh being drawn with a texture applied to it. Although I did like how much easier it was to get to this point, I really enjoyed having to control all of the small details with Vulkan. I had previously tried to setup Vulkan using the ash crate, but had stumbled massively due to being unfamiliar with the syntax and the fact that when using C++, I used a great library called VkBootstrap which abstracted away the boilerplate code needed to get Vulkan up and running. However, after getting to this point with wgpu, I felt a bit more confident and decided to try again. This time, I made heavy use of the ash examples and my C++ code to get through the initial boilerplate and get a Vulkan app running. I now have this:

vulkan

It’s not even a triangle yet, but it’s nearly there! I will need to create some simple shaders, compile them and setup a PSO, but hopefully soon I will have that first initial triangle to start my Rust Vulkan adventure. Comparing my experience to C++, the Vulkan code has been quite similar and most of my positives(for example using vk::PipelineStageFlags2::NONE in Rust instead of VK_PIPELINE_STAGE_2_NONE in C++) would probably have been found if I had used vulkan.hpp in C++. However, once I create that initial triangle and start to add more functionality, I am sure that I will be able to start comparing structural differences of my Rust code to my C++ code.

I am excited to create a more advanced renderer in Rust, but instead of setting myself large goals immediately, I am going to set myself a few tasks every week that seem reasonable to do. One of my problems previously when exploring Vulkan was barely focusing on the graphics programming side of things, which I know sounds odd. I would spend weeks seemingly tinkering with my engine for nothing to look any different when I ran the program, and although these changes were making the underlying code better, I lost interest quicker due to not seeing much visual difference. I think this time I need to keep my goals simpler and try not to make too many architectural changes too early, and instead focus on smaller incremental changes to add graphics features to my renderer. Furthermore, I think I need to also enjoy the process more. It’s hard looking around on Reddit and Discord, seeing the amazing things that people create with these Graphics APIs, and not comparing your progress to theirs, but ultimately I should be happy that if I persevere and stick with learning Vulkan, then it is even possible for me to create something similar.