Vulkan规范:第九章 9.8 管线的绑定

一旦管线被创建完成,可以使用一个命令把它绑定到命令缓冲区:

void vkCmdBindPipeline(
    VkCommandBuffer                             commandBuffer,
    VkPipelineBindPoint                         pipelineBindPoint,
    VkPipeline                                  pipeline);
  • commandBuffer 是管线将要绑定的命令缓冲区。

  • pipelineBindPoint 指定了绑定点,必须是如下的值之一。

    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 是将被绑定的管线。

绑定完成后,该绑定影响命令缓冲区中稍后的图形和计算命令,直到新的管线被绑定到绑定点。 绑定到VK_PIPELINE_BIND_POINT_COMPUTE的管线控制了vkCmdDispatch and vkCmdDispatchIndirect的行为。 绑定到VK_PIPELINE_BIND_POINT_GRAPHICS的管线控制了vkCmdDrawvkCmdDrawIndexedvkCmdDrawIndirect, and vkCmdDrawIndexedIndirect的行为。 其他的命令不受管线状态的影响。

正确使用

  • 若 pipelineBindPoint 是 VK_PIPELINE_BIND_POINT_COMPUTE,分配出commandBuffer 的VkCommandPool 必须支持计算操作。

  • 若 pipelineBindPoint 是 VK_PIPELINE_BIND_POINT_GRAPHICS,分配出commandBufferVkCommandPool 必须支持图像操作。

  • 若 pipelineBindPoint 是 VK_PIPELINE_BIND_POINT_COMPUTEpipeline 必须是计算管线。

  • 若 pipelineBindPoint 是 VK_PIPELINE_BIND_POINT_GRAPHICSpipeline 必须是图形管线。

  • variable multisample rate 特征不受支持,pipeline 就是图形管线,当前subpass没有附件,当转移到当前subpass后 这并不是第一次对图形管线调用这个函数,由此管线指定的采样数必须和前一个管线匹配。

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

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

Command Buffer LevelsRender Pass ScopeSupported Queue TypesPipeline Type

Primary
Secondary

Both

Graphics
compute

 
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值