Using Vulkan descriptor indexing
Descriptor indexing became a part of the Vulkan core in version 1.2 as an optional feature. Vulkan 1.3 made it mandatory. This feature allows applications to put all the resources they have into one huge descriptor set and make it available to all shaders. There is no need to manage descriptor pools, and no need to construct per-shader descriptor sets. Everything is available to the shaders at once. Shaders can access all resources in the system, and the only practical limit is performance.
Let us learn how to work with descriptor sets and descriptor indexing Vulkan by exploring the LightweightVK framework.
How to do it...
Let’s take a look at some parts of the lvk::VulkanContext
class that deals with descriptors. The VulkanContext
class declaration in lightweightvk/lvk/vulkan/VulkanClasses.h
contains these member fields. The integer variables store the maximal number of resources that can be stored in the currently allocated descriptor set vkDSet_...