Vulkan resource bindings: levels of indirection?

I am new to Vulkan and since I find it rather challenging to navigate the documentation, I hope that someone here can answer this for me. Does Vulkan offer support (either as core or as an extension) for indirect resource binding, that is, can a descriptor set include a pointer to another descriptor set and if yes, how does this functionality look like? Another question: can bindings be manipulated in the shader code, that is, can you use a shader to change the binding point to another resource (e.g. is it possible to set up a compute shader that would set up texture and /or buffer bindings for a subsequent render operation?)

P.S. For the sake of clarity — this is more of an academic question about API capabilities. I don’t have a use case that would absolutely require this functionality and I am aware that in many practical cases, one can work around it.

No.

No.

However, Vulkan does permit implementations to have very generous capabilities with regard to arrays of texture descriptors. An array of textures in a descriptor is only considered 1 descriptor regardless of how many actual elements are in the array. And desktop Vulkan implementations give you a pretty forgiving limit, typically in the hundreds or thousands. They also support dynamic array indexing for such arrays, which is very important.

Given such an array, a shader can write an index into that array which another shader could read and use to pick which texture to use.

Also, you could just use array textures, but that requires that all textures have the same size and format.

You can array buffer descriptors as well, but the limitations there are typically a lot more restrictive.

Thank you for the detailed and precise response!

P.S. Also, very nice to see a familiar name! I remember you from the OpenGL forums, some good 10 or 15 years ago :slight_smile: Hope you are doing fine.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.