descriptor indexing example
I have a question on the descriptor indexing example.
As far as I know, DescriptorIndexing::render is called every from to record commands on a command buffer and submit the buffer for rendering. To show how to use the descriptor indexing extension, it binds descriptors.descriptor_set_update_after_bind, and then update it in the loop.
https://github.com/KhronosGroup/Vulkan-Samples/blob/8e966ebfad343112286ed705eca6be4472dd85df/samples/extensions/descriptor_indexing/descriptor_indexing.cpp#L127-L149
However as its comment says "We can update descriptors at any time, as long as the GPU is not actually accessing the descriptor.", it is updating while the GPU is accessing it. In my debugging, current_buffer variable changes like this: 0, 1, 2, 0, 1, 2. This means we get the current_buffer 0 and record and submit with it for frame 0, and then for frame 1, we don't wait for frame 0 and just update the descriptorset and submit it. While updating the desciptor set for frame 1, the frame 0 is not done yet, which means the GPU could be accessing the descriptorset.
In this case, I think the example is doing what the comment says you should not do. Please correct me If I'm wrong. Thanks.
Hi @HansKristian-Work, can you take a look at this issue with the descriptor indexing sample? Is this a problem we need to address? Thanks