Implementing indirect rendering with Vulkan
In the previous chapters, we covered geometry rendering with basic texturing. In the previous recipe Using descriptor indexing and arrays of textures in Vulkan, we learned how to wrangle multiple textures. This recipe explains how to use Vulkan’s indirect rendering feature to render the scene data discussed earlier in the chapter, specifically in the recipes Loading and saving a scene graph and Implementing a material system. While this recipe doesn’t have a standalone example app, all the helper code provided here will be used in the upcoming recipes.
Indirect rendering allows a significant part of scene traversal to be precalculated and offloaded from the CPU to the GPU, which can greatly boost performance. The key idea is to organize all scene data into arrays that shaders can access using integer IDs, eliminating the need for any API state changes during rendering. The indirect buffer generated by the application contains...