VkCopyMemoryToImageInfo(3)

Name

VkCopyMemoryToImageInfo - Structure specifying parameters of host memory to image copy command

C Specification

The VkCopyMemoryToImageInfo structure is defined as:

// Provided by VK_VERSION_1_4
typedef struct VkCopyMemoryToImageInfo {
    VkStructureType               sType;
    const void*                   pNext;
    VkHostImageCopyFlags          flags;
    VkImage                       dstImage;
    VkImageLayout                 dstImageLayout;
    uint32_t                      regionCount;
    const VkMemoryToImageCopy*    pRegions;
} VkCopyMemoryToImageInfo;
// Provided by VK_EXT_host_image_copy
// Equivalent to VkCopyMemoryToImageInfo
typedef VkCopyMemoryToImageInfo VkCopyMemoryToImageInfoEXT;

Members

  • sType is a VkStructureType value identifying this structure.

  • pNext is NULL or a pointer to a structure extending this structure.

  • flags is a bitmask of VkHostImageCopyFlagBits values describing additional copy parameters.

  • 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 VkMemoryToImageCopy structures specifying the regions to copy.

Description

vkCopyMemoryToImage does not check whether the device memory associated with dstImage is currently in use before performing the copy. The application must guarantee that any previously submitted command that reads from or writes to the copy regions has completed before the host performs the copy.

Copy regions for the image must be aligned to a multiple of the texel block extent in each dimension, except at the edges of the image, where region extents must match the edge of the image.

Valid Usage
  • VUID-VkCopyMemoryToImageInfo-dstImage-09109
    If dstImage is sparse then all memory ranges accessed by the copy command must be bound as described in Binding Resource Memory

  • VUID-VkCopyMemoryToImageInfo-dstImage-09111
    If the stencil aspect of dstImage is accessed, and dstImage was not created with separate stencil usage, dstImage must have been created with the VK_IMAGE_USAGE_HOST_TRANSFER_BIT usage flag set

  • VUID-VkCopyMemoryToImageInfo-dstImage-09112
    If the stencil aspect of dstImage is accessed, and dstImage was created with separate stencil usage, dstImage must have been created with the VK_IMAGE_USAGE_HOST_TRANSFER_BIT usage flag set

  • VUID-VkCopyMemoryToImageInfo-dstImage-09113
    If non-stencil aspects of dstImage are accessed, dstImage must have been created with the VK_IMAGE_USAGE_HOST_TRANSFER_BIT usage flag set

  • VUID-VkCopyMemoryToImageInfo-imageOffset-09114
    If flags contains VK_HOST_IMAGE_COPY_MEMCPY_BIT, the x, y, and z members of the imageOffset member of each element of pRegions must be 0

  • VUID-VkCopyMemoryToImageInfo-dstImage-09115
    If flags contains VK_HOST_IMAGE_COPY_MEMCPY_BIT, the imageExtent member of each element of pRegions must equal the extents of dstImage identified by imageSubresource

  • VUID-VkCopyMemoryToImageInfo-dstImage-07966
    If dstImage is non-sparse then the image or each specified disjoint plane must be bound completely and contiguously to a single VkDeviceMemory object

  • VUID-VkCopyMemoryToImageInfo-imageSubresource-07967
    The imageSubresource.mipLevel member of each element of pRegions must be less than the mipLevels specified in VkImageCreateInfo when dstImage was created

  • VUID-VkCopyMemoryToImageInfo-imageSubresource-07968
    If imageSubresource.layerCount is not VK_REMAINING_ARRAY_LAYERS, imageSubresource.baseArrayLayer + imageSubresource.layerCount of each element of pRegions must be less than or equal to the arrayLayers specified in VkImageCreateInfo when dstImage was created

  • VUID-VkCopyMemoryToImageInfo-dstImage-07969
    dstImage must not have been created with flags containing VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT

  • VUID-VkCopyMemoryToImageInfo-imageSubresource-07971
    For each element of pRegions, imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the width of the specified imageSubresource of dstImage

  • VUID-VkCopyMemoryToImageInfo-imageSubresource-07972
    For each element of pRegions, imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the height of the specified imageSubresource of dstImage

  • VUID-VkCopyMemoryToImageInfo-dstImage-07973
    dstImage must have a sample count equal to VK_SAMPLE_COUNT_1_BIT

  • VUID-VkCopyMemoryToImageInfo-memoryRowLength-09106
    For each element of pRegions, memoryRowLength must be a multiple of the texel block extent width of the VkFormat of dstImage

  • VUID-VkCopyMemoryToImageInfo-memoryImageHeight-09107
    For each element of pRegions, memoryImageHeight must be a multiple of the texel block extent height of the VkFormat of dstImage

  • VUID-VkCopyMemoryToImageInfo-memoryRowLength-09108
    For each element of pRegions, memoryRowLength divided by the texel block extent width and then multiplied by the texel block size of dstImage must be less than or equal to 231-1

  • VUID-VkCopyMemoryToImageInfo-dstImageLayout-09059
    dstImageLayout must specify the current layout of the image subresources of dstImage specified in pRegions

  • VUID-VkCopyMemoryToImageInfo-dstImageLayout-09060
    dstImageLayout must be one of the image layouts returned in VkPhysicalDeviceHostImageCopyProperties::pCopyDstLayouts

  • VUID-VkCopyMemoryToImageInfo-flags-09393
    If flags includes VK_HOST_IMAGE_COPY_MEMCPY_BIT, for each region in pRegions, memoryRowLength and memoryImageHeight must both be 0

Valid Usage (Implicit)
  • VUID-VkCopyMemoryToImageInfo-sType-sType
    sType must be VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO

  • VUID-VkCopyMemoryToImageInfo-pNext-pNext
    pNext must be NULL

  • VUID-VkCopyMemoryToImageInfo-flags-parameter
    flags must be a valid combination of VkHostImageCopyFlagBits values

  • VUID-VkCopyMemoryToImageInfo-dstImage-parameter
    dstImage must be a valid VkImage handle

  • VUID-VkCopyMemoryToImageInfo-dstImageLayout-parameter
    dstImageLayout must be a valid VkImageLayout value

  • VUID-VkCopyMemoryToImageInfo-pRegions-parameter
    pRegions must be a valid pointer to an array of regionCount valid VkMemoryToImageCopy structures

  • VUID-VkCopyMemoryToImageInfo-regionCount-arraylength
    regionCount must be greater than 0

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.