2
votes

The only way I can find is to change all of them which is quite annoying. Let's say I have three dynamic uniform buffer for lighting, transform and bones in a single descriptor set. When I come to the place I need to update the bone, I don't even know (or care) what is the current lighting unless I save all of the offset somewhere every time I update the offsets.

1

1 Answers

2
votes

I don't even know (or care) what is the current lighting

You also don't really know or care about the other stuff in the descriptor set, but you still have to provide it in order to update a dynamic buffer binding. That's just the nature of the functionality.

So wherever you store the descriptor set, you can also store an array containing the current bindings. So you just modify that array, then use that array as your pDynamicOffsets array.

While there may be alternative mechanisms that may be available to you for accomplishing the same task (push constants, the push descriptor extension, the descriptor indexing extension), if you're using dynamic offsets, you have to specify all of the dynamic offsets in the descriptor set each time.

That having been said, it is entirely possible for you to put different kinds of descriptors into different descriptor sets. Lighting information probably changes less frequently than transform information; after all, not all of your shaders will be rendering skinned objects, but all of your shaders will be doing lighting with those parameters. So putting per-frame lighting information in set 0 and per-object transform stuff in set 1 makes a lot of sense to me.

So perhaps your problem can be solved simply by using more descriptor sets.