Some rules for valid operation are common to all copy commands:
VK_IMAGE_LAYOUT_GENERAL
or
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
layout. Destination image
subresources must be in either the VK_IMAGE_LAYOUT_GENERAL
or
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
layout. As a consequence, if
an image subresource is used as both source and destination of a copy,
it must be in the VK_IMAGE_LAYOUT_GENERAL
layout.
VK_IMAGE_USAGE_TRANSFER_SRC_BIT
usage bit enabled and destination
images must have been created with the
VK_IMAGE_USAGE_TRANSFER_DST_BIT
usage bit enabled.
VK_BUFFER_USAGE_TRANSFER_SRC_BIT
usage bit enabled and destination
buffers must have been created with the
VK_BUFFER_USAGE_TRANSFER_DST_BIT
usage bit enabled.
All copy commands are treated as “transfer” operations for the purposes of synchronization barriers.