Saturday, October 30, 2021

Vulcan, Go, and A Triangle, Part 11

In this part, I used the previous created semaphores and fences to coordinate rendering and presentation. I also implement resizing of the window.

This part follows along with Drawing a triangle / Drawing / Rendering and presentation / Acquiring an image from the swap chain through to the end of Drawing a triangle / Swap chain recreation.

Thursday, October 28, 2021

Vulcan, Go, and A Triangle, Part 10

In this part, I created the command pool, the command buffers, and recorded the rendering to our framebuffers.

This part is a direct translation of Drawing a triangle / Drawing / Command buffers.

Tuesday, October 26, 2021

Vulcan, Go, and A Triangle, Part 9

In this part, I made the pipeline objects. This includes loading the shader modules, configuring the fixed functions, and creating the Vulkan pipelines. This part started with Drawing a triangle / Graphics pipeline basics / Shader modules, jumps into the Fixed functions, and ends with the Conclusion.

Sunday, October 24, 2021

Vulcan, Go, and A Triangle, Part 8

In this part, I made the image views, render pass, framebuffers and pipeline layout. All things that only modify the pipeline file. I found Drawing a triangle / Graphics pipeline basics / Introduction an excellent reminder about computer graphics in general and useful for understanding vulkan in particular.

This part doesn't relate to a single section in the Vulkan tutorial; it jumps around between a couple of different sections that were all pipeline specific and would need to be recreated if the pipeline needed to be recreated. It also references the Vulkan Tutorial almost constantly, as I didn't want to plagiarize their excellent explanations of these concepts.

Friday, October 22, 2021

Vulcan, Go, and A Triangle, Part 7

In this part, I am going to add the the swapchain. My application will eventually take one of these swap chain images and draw to it, but that will be closer to the end of this tutorial.

This part follows closely with Drawing a triangle / Presentation / Image Views. I've opted to keep swapchain a single word, regardless of my spell checker; this is mostly because Vulkan treats it as one word in the API. So expect to see Swapchain where the Vulkan Tutorial would have written SwapChain.

Wednesday, October 20, 2021

Vulcan, Go, and A Triangle, Part 6

In this part we are going to add support for required device layers and extensions before creating a logical device. The logical device creation process is similar to the instance creation process. Instead of telling Vulkan about our application, we will be telling Vulkan about our device requirements.

This part follows closely with the Vulkan Tutorial. I do push the required extensions checks into the device selection function, but otherwise the steps are similar to Drawing a triangle / Setup / Logical device and queues.

Monday, October 18, 2021

Vulcan, Go, and A Triangle, Part 5

In this part I am going to create an object for keeping track of our physical device, enumerate over physical devices, and select a physical device for our application.

I deviate from the vulkan tutorial here a little bit because I wanted to encapsulate physical device related functionality in a specific class. This will become more useful later when dealing with memory buffers. I also create the surface in a different order.

This part relates to Drawing a triangle / Setup / Physical devices and queue families in the original tutorial.

Sunday, October 17, 2021

Vulcan, Go, and A Triangle, Part 4

In this part of the tutorial, I'm going to inspect what extensions and layers are available for an instance. The call to vk.CreateInstance can result in vk.ErrorLayerNotPresent or vk.ErrorExtensionNotPresent according to the Vulkan spec. By inspecting the available options and checking if my required options are supported, I can provide a more debuggable error response.

Following the Vulkan Tutorial, I implemented the necessary functions to enumerate over available layers and extensions before calling CreateInstance. This part relates to Drawing a triangle / Setup / Instance / Checking for extension support in the original tutorial.

Saturday, October 16, 2021

Vulcan, Go, and A Triangle, Part 3

In this part of the tutorial, we are going to initialize a vulkan instance. The vulkan instance is the connection between your application and the Vulkan framework. It allows the application to enumerate physical devices and supported functionality.

This part relates to Drawing a triangle / Setup / Instance in the original tutorial.

Vulcan, Go, and A Triangle, Part 2

In the last part, we started with adding dependencies, helper functions and the basic skeleton. In this part we are going to start expanding on setup()cleanup(), and mainLoop().

Each part going forward will end with code that should build and run, although in many cases there will not be a visible output.

Part 2 roughly translates to the second half of Drawing a triangle / Setup / Base code.

Vulcan, Go, and A Triangle, Part 1

This tutorial follows my personal execution of the Vulkan tutorial, with the distinction of being in Go instead of C++.

I started this effort because Go is my preferred programming language and I was interested in understanding more about the modern landscape of GPU programing. While I was able to find a Vulkan tutorial translated for Rust, I could not find an existing one for Go.

While my exploration of Vulkan follows the general approach of the Vulkan Tutorial, I have done certain steps out of order and try to leverage Go idioms where I can. I also tried to write the code so that most steps start with pseudo-code comments which eventually get expanded into code-blocks.