vkCopyMemoryToImage(3)

Name

vkCopyMemoryToImage - Copy data from host memory into an image

C Specification

To copy data from host memory to an image object, call:

// Provided by VK_VERSION_1_4
VkResult vkCopyMemoryToImage(
    VkDevice                                    device,
    const VkCopyMemoryToImageInfo*              pCopyMemoryToImageInfo);
// Provided by VK_EXT_host_image_copy
// Equivalent to vkCopyMemoryToImage
VkResult vkCopyMemoryToImageEXT(
    VkDevice                                    device,
    const VkCopyMemoryToImageInfo*              pCopyMemoryToImageInfo);

Parameters

  • device is the device which owns pCopyMemoryToImageInfo->dstImage.

  • pCopyMemoryToImageInfo is a pointer to a VkCopyMemoryToImageInfo structure describing the copy parameters.

Description

This command is functionally similar to vkCmdCopyBufferToImage2, except it is executed on the host and reads from host memory instead of a buffer. The memory of pCopyMemoryToImageInfo->dstImage is accessed by the host as if coherent.

Because queue submissions automatically make host memory visible to the device, there would not be a need for a memory barrier before using the results of this copy operation on the device.

Valid Usage (Implicit)
  • VUID-vkCopyMemoryToImage-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkCopyMemoryToImage-pCopyMemoryToImageInfo-parameter
    pCopyMemoryToImageInfo must be a valid pointer to a valid VkCopyMemoryToImageInfo structure

Return Codes
Success
  • VK_SUCCESS

Failure
  • VK_ERROR_INITIALIZATION_FAILED

  • VK_ERROR_MEMORY_MAP_FAILED

  • VK_ERROR_OUT_OF_DEVICE_MEMORY

  • VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_ERROR_UNKNOWN

  • VK_ERROR_VALIDATION_FAILED

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.