Once a pipeline has been created, it can be bound to the command buffer using the command:
void vkCmdBindPipeline( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
commandBuffer
is the command buffer that the pipeline will be
bound to.
pipelineBindPoint
specifies the bind point, and must have one of
the values
typedef enum VkPipelineBindPoint { VK_PIPELINE_BIND_POINT_GRAPHICS = 0, VK_PIPELINE_BIND_POINT_COMPUTE = 1, } VkPipelineBindPoint;
specifying whether pipeline
will be bound as a compute
(VK_PIPELINE_BIND_POINT_COMPUTE
) or graphics
(VK_PIPELINE_BIND_POINT_GRAPHICS
) pipeline. There are separate bind
points for each of graphics and compute, so binding one does not disturb the
other.
pipeline
is the pipeline to be bound.
Once bound, a pipeline binding affects subsequent graphics or compute
commands in the command buffer until a different pipeline is bound to the
bind point. The pipeline bound to VK_PIPELINE_BIND_POINT_COMPUTE
controls the behavior of vkCmdDispatch
and
vkCmdDispatchIndirect
. The pipeline bound to
VK_PIPELINE_BIND_POINT_GRAPHICS
controls the behavior of
vkCmdDraw
, vkCmdDrawIndexed
, vkCmdDrawIndirect
, and
vkCmdDrawIndexedIndirect
. No other commands are affected by the
pipeline state.