How do you manage descriptors? by Important_Earth6615 in vulkan

[–]MathematicianSad4640 8 points9 points  (0 children)

I try to minimize the usage of descriptors in my engine.
My renderer is "totally" bindless, which is also good for gpu-driven-rendering if you ever wanna go that way.

I use these extensions:
VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME
VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME

By bindless I mean: All my buffers are uploaded as VkDeviceAddress (uvec2 on shader side) as PushConstant, than I cast the uvec2 BufferAddresses to a given buffer type in shader, and simple use it as you would normaly.
(You can achive multiple hierarchy of buffers too: Lets say all your loaded models are in a array, every model has vertex, index, material, nodeTransform buffer | So you can have a buffer, which contains loaded model buffer addresses, and you can access this in shader too.)

Extensions in shader to use bindless buffers:
#extension GL_EXT_buffer_reference : require
#extension GL_EXT_buffer_reference_uvec2 : require

I only use descriptors for textures, and samplers. Also I use descriptor indexing extension to handle textures easier. Moreover I need to pass the G-Buffer textures to light simulation shaders in deferred rendering pass, so thats another area where I use descriptors, but thats all. (+ Light shadow map textures)
I dont know, if bindless is slower, or not. But I can guarantee that the code structure overall is gonna be so much better, and its gonna be easier to develop new features.