Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 52d170e

Browse files
Clarify location to call vkCmdBindDescriptorSets
The call to vkCmdBindDescriptorSets() needs to happen before vkCmdDrawIndex() otherwise runtime errors might appear like: Validation(ERROR): msg_code: 62: Object: 0x555e4d0ebac0 (Type = 6) | VkPipeline 0xe uses set #0 but that set is not bound. Add some extra context to make this more explicit.
1 parent 387e4e5 commit 52d170e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

05_Uniform_buffers/01_Descriptor_pool_and_sets.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,12 @@ as its name implies.
199199
## Using a descriptor set
200200
201201
We now need to update the `createCommandBuffers` function to actually bind the
202-
descriptor set to the descriptors in the shader with `cmdBindDescriptorSets`:
202+
descriptor set to the descriptors in the shader with `cmdBindDescriptorSets`,
203+
this needs to be done before the `vkCmdDrawIndexed` call:
203204
204205
```c++
205206
vkCmdBindDescriptorSets(commandBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSet, 0, nullptr);
207+
vkCmdDrawIndexed(commandBuffers[i], static_cast<uint32_t>(indices.size()), 1, 0, 0, 0);
206208
```
207209

208210
Unlike vertex and index buffers, descriptor sets are not unique to graphics

0 commit comments

Comments
 (0)