Copying data content between images and buffers
Copy commands are special transfer commands that transfer data contents from one memory region to another. These regions could be between buffers objects, image objects, and buffer-to-image and vice versa.
Depending upon the application need, you may need to copy data between buffers and images in various situations. There are four types of copy commands available to accomplish this job:
vkCmdCopyBuffer
: Data contents are copied from the source buffer to the destination buffer object's device memoryvkCmdCopyImage
: A specific portion of the source image object is copied to the destination image regionvkCmdCopyBufferToImage
: Buffer object data contents are copied to the image objectsvkCmdCopyImageToBuffer
: Image object data contents are copied to the buffer objects
In the optimal tiling implementation, we used vkCmdCopyBufferToImage
. The following is the syntax:
void vkCmdCopyBufferToImage( VkCommandBuffer commandBuffer...