VKCMDBINDPIPELINE(3)

NAME
vkCmdBindPipeline - Bind a pipeline object to a command buffer

C SPECIFICATION

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);

PARAMETERS

    • 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.

DESCRIPTION

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. Valid Usage

    • If pipelineBindPoint is VK_PIPELINE_BIND_POINT_COMPUTE, the VkCommandPool that commandBuffer was allocated from must support compute operations

    • If pipelineBindPoint is VK_PIPELINE_BIND_POINT_GRAPHICS, the VkCommandPool that commandBuffer was allocated from must support graphics operations

    • If pipelineBindPoint is VK_PIPELINE_BIND_POINT_COMPUTE, pipeline must be a compute pipeline

    • If pipelineBindPoint is VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline must be a graphics pipeline

    • If the variable multisample rate feature is not supported, pipeline is a graphics pipeline, the current subpass has no attachments, and this is not the first call to this function with a graphics pipeline after transitioning to the current subpass, then the sample count specified by this pipeline must match that set in the previous pipeline
Valid Usage (Implicit)

    • commandBuffer must be a valid VkCommandBuffer handle

    • pipelineBindPoint must be a valid VkPipelineBindPoint value

    • pipeline must be a valid VkPipeline handle

    • commandBuffer must be in the recording state

    • The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations

    • Both of commandBuffer, and pipeline must have been created, allocated, or retrieved from the same VkDevice
Host Synchronization

    • Host access to commandBuffer must be externally synchronized
Command Properties
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Both | GRAPHICS COMPUTE

SEE ALSO

VkCommandBuffer, VkPipeline, VkPipelineBindPoint

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdBindPipeline

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.