Vulkan upgrades

For Vulkan the process of upgrading was considerably more complicated. In Vulkan, we need the following objects:

  • Render passes
  • Framebuffers
  • Graphics pipelines

The main issue is that the graphics pipelines and framebuffers are dependent upon the renderpass. So when a renderpass is to be updated, all other objects are required to be recreated as well for the new renderpass. This forces us to defer the construction of graphics pipelines and framebuffers in the render code rather than ahead of time.

Another complication is related to the restriction of updating descriptor sets on bound command buffers: Updating a descriptor set that is in a command list that is either being recorded or executed on the GPU will invalidate the command buffer, causing undefined behaviour unless the debug layers are enabled. Ideally, we would create all combinations of textures we use in all render calls and take the one for the specific combination we are interested in. However, for now we simply have a single descriptor set per mesh per frame.