KhronosGroup / KhronosGroup/Vulkan-Samples
descriptor indexing example
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 5.4k
- Forks
- 835
- Avg merge
- 2h 16m
- Merged PRs (30d)
- 1
Description
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.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with samples/extensions/descriptor_indexing/descriptor_indexing.cpp at the linked lines 127-149, then trace how current_buffer changes across render calls and command-buffer submission. Check the descriptor update timing against GPU access and the example's synchronization flow. Done means resolving whether the example violates its own comment and correcting the example or documenting the explanation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100