vkCmdCopyImageToBuffer2(3)

# vkCmdCopyImageToBuffer2(3) Manual Page

## Name

vkCmdCopyImageToBuffer2 - Copy image data into a buffer

Loading… please wait.

## C Specification

To copy data from an image object to a buffer object, call:

    // Provided by VK_VERSION_1_3
    void vkCmdCopyImageToBuffer2(
        VkCommandBuffer                             commandBuffer,
        const VkCopyImageToBufferInfo2*             pCopyImageToBufferInfo);

or the equivalent command

    // Provided by VK_KHR_copy_commands2
    void vkCmdCopyImageToBuffer2KHR(
        VkCommandBuffer                             commandBuffer,
        const VkCopyImageToBufferInfo2*             pCopyImageToBufferInfo);

## Parameters

- `commandBuffer` is the command buffer into which the command will be recorded.

- `pCopyImageToBufferInfo` is a pointer to a VkCopyImageToBufferInfo2 structure describing the copy parameters.

## Description

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

Valid Usage

- VUID-vkCmdCopyImageToBuffer2-commandBuffer-01831
  If `commandBuffer` is an unprotected command buffer and `protectedNoFault` is not supported, `srcImage` must not be a protected image

- VUID-vkCmdCopyImageToBuffer2-commandBuffer-01832
  If `commandBuffer` is an unprotected command buffer and `protectedNoFault` is not supported, `dstBuffer` must not be a protected buffer

- VUID-vkCmdCopyImageToBuffer2-commandBuffer-01833
  If `commandBuffer` is a protected command buffer and `protectedNoFault` is not supported, `dstBuffer` must not be an unprotected buffer

Valid Usage (Implicit)

- VUID-vkCmdCopyImageToBuffer2-commandBuffer-parameter
  `commandBuffer` must be a valid VkCommandBuffer handle

- VUID-vkCmdCopyImageToBuffer2-pCopyImageToBufferInfo-parameter
  `pCopyImageToBufferInfo` must be a valid pointer to a valid VkCopyImageToBufferInfo2 structure

- VUID-vkCmdCopyImageToBuffer2-commandBuffer-recording
  `commandBuffer` must be in the recording state

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

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

- VUID-vkCmdCopyImageToBuffer2-videocoding
  This command must only be called outside of a video coding scope

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 | Video Coding Scope | Supported Queue Types | Command Type
--- | --- | --- | --- | ---
Primary Secondary | Outside | Outside | Transfer Graphics Compute | Action

## See Also

VK_KHR_copy_commands2, VK_VERSION_1_3, VkCommandBuffer, VkCopyImageToBufferInfo2

## 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

Copyright 2014-2022 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0