Binding a pipeline object
Before we can issue drawing commands or dispatch computational work, we need to set up all the required states for the command to be successfully performed. One of the required states is binding a pipeline object to the command buffer--a graphics pipeline if we want to draw objects on screen or a compute pipeline if we want to perform computational work.
How to do it...
- Take the handle of a command buffer and store it in a variable of type
VkCommandBuffer
namedcommand_buffer
. Make sure the command buffer is in the recording state. - If a graphics pipeline needs to be bound, make sure the beginning of a render pass has already been recorded in the
command_buffer
. If a compute pipeline should be bound, make sure no render pass is started or any render passes are finished in thecommand_buffer
. - Take the handle of a pipeline object. Use it to initialize a variable of type
VkPipeline
namedpipeline
. - Call
vkCmdBindPipeline( command_buffer, pipeline_type, pipeline )
. Provide...