Using descriptor indexing in Vulkan to render an ImGui
Another extremely useful application of descriptor indexing is the ability to trivially render multiple textures in ImGui. Up until now, our ImGui renderer was able to use only one single font texture and there was no possibility to render any static images in our UI. To allow backward compatibility with Chapter 4, Adding User Interaction and Productivity Tools, and Chapter 5, Working with Geometry Data, we add a new constructor to the ImGuiRenderer
class and modify the addImGuiItem()
method in the shared/vkRenderers/VulkanImGui.cpp
file. We provide a thorough discussion of the required changes here because, to the best of our knowledge, there is no small down-to-earth tutorial on using multiple textures in the Vulkan ImGui renderer.
Getting ready
Check the previous Using descriptor indexing and texture arrays in Vulkan recipe, to learn how to initialize the descriptor indexing feature.
How to do it...
Let's start...