VKCMDCOPYBUFFERTOIMA(3)

NAME
vkCmdCopyBufferToImage - Copy data from a buffer into an image.

C SPECIFICATION

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

    void vkCmdCopyBufferToImage(
        VkCommandBuffer                             commandBuffer,
        VkBuffer                                    srcBuffer,
        VkImage                                     dstImage,
        VkImageLayout                               dstImageLayout,
        uint32_t                                    regionCount,
        const VkBufferImageCopy*                    pRegions);

PARAMETERS

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

    • srcBuffer is the source buffer.

    • dstImage is the destination image.

    • dstImageLayout is the layout of the destination image subresources for the copy.

    • regionCount is the number of regions to copy.

    • pRegions is a pointer to an array of VkBufferImageCopy structures specifying the regions to copy.

DESCRIPTION

Each region in pRegions is copied from the specified region of the source buffer to the specified region of the destination image.

VALID USAGE

    • commandBuffer must be a valid VkCommandBuffer handle

    • srcBuffer must be a valid VkBuffer handle

    • dstImage must be a valid VkImage handle

    • dstImageLayout must be a valid VkImageLayout value

    • pRegions must be a pointer to an array of regionCount valid VkBufferImageCopy structures

    • commandBuffer must be in the recording state

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

    • This command must only be called outside of a render pass instance

    • regionCount must be greater than 0

    • Each of commandBuffer, dstImage, and srcBuffer must have been created, allocated, or retrieved from the same VkDevice

    • The buffer region specified by a given element of pRegions must be a region that is contained within srcBuffer

    • The image region specified by a given element of pRegions must be a region that is contained within dstImage

    • The union of all source regions, and the union of all destination regions, specified by the elements of pRegions, must not overlap in memory

    • srcBuffer must have been created with VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag

    • dstImage must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag

    • dstImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT

    • dstImageLayout must specify the layout of the image subresources of dstImage specified in pRegions at the time this command is executed on a VkDevice

    • dstImageLayout must be either of VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or VK_IMAGE_LAYOUT_GENERAL

HOST SYNCHRONIZATION

    • Host access to commandBuffer must be externally synchronized

COMMAND PROPERTIES
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Outside | TRANSFER GRAPHICS COMPUTE

SEE ALSO

VkBuffer, VkBufferImageCopy, VkCommandBuffer, VkImage, VkImageLayout

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

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

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.