C Specification

To copy data between buffer objects, call:

// Provided by VK_KHR_copy_commands2
void vkCmdCopyBuffer2KHR(
    VkCommandBuffer                             commandBuffer,
    const VkCopyBufferInfo2KHR*                 pCopyBufferInfo);

Parameters

  • commandBuffer is the command buffer into which the command will be recorded.

  • pCopyBufferInfo is a pointer to a VkCopyBufferInfo2KHR structure describing the copy parameters.

Description

This command is functionally identical to vkCmdCopyBuffer, but includes extensible sub-structures that include sType and pNext parameters, allowing them to be more easily extended.

Valid Usage
  • VUID-vkCmdCopyBuffer2KHR-commandBuffer-01822
    If commandBuffer is an unprotected command buffer, then srcBuffer must not be a protected buffer

  • VUID-vkCmdCopyBuffer2KHR-commandBuffer-01823
    If commandBuffer is an unprotected command buffer, then dstBuffer must not be a protected buffer

  • VUID-vkCmdCopyBuffer2KHR-commandBuffer-01824
    If commandBuffer is a protected command buffer, then dstBuffer must not be an unprotected buffer

Valid Usage (Implicit)
  • VUID-vkCmdCopyBuffer2KHR-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

  • VUID-vkCmdCopyBuffer2KHR-pCopyBufferInfo-parameter
    pCopyBufferInfo must be a valid pointer to a valid VkCopyBufferInfo2KHR structure

  • VUID-vkCmdCopyBuffer2KHR-commandBuffer-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdCopyBuffer2KHR-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support transfer, graphics, or compute operations

  • VUID-vkCmdCopyBuffer2KHR-renderpass
    This command must only be called outside of a render pass instance

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 Levels Render Pass Scope Supported Queue Types Pipeline Type

Primary
Secondary

Outside

Transfer
Graphics
Compute

Transfer

See Also

Document Notes

For more information, see the Vulkan Specification

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

Copyright 2014-2021 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0