Binding descriptor sets
When a descriptor set is ready (we have updated it with all the resources that will be accessed in shaders), we need to bind it to a command buffer during the recording operation.
How to do it...
- Take the handle of a command buffer that is being recorded. Store the handle in a variable of type
VkCommandBuffer
namedcommand_buffer
. - Create a variable of type
VkPipelineBindPoint
namedpipeline_type
that will represent the type of a pipeline (graphics or compute) in which descriptor sets will be used. - Take the pipeline's layout and store its handle in a variable of type
VkPipelineLayout
namedpipeline_layout
(refer to the Creating a pipeline layout recipe from Chapter 8, Graphics and Compute Pipelines). - Create a variable of type
std::vector<VkDescriptorSet>
nameddescriptor_sets
. For each descriptor set that should be bound to the pipeline, add a new element to the vector and initialize it with the descriptor set's handle. - Select an index to which the first set from the...