vkCmdCopyImage2(3)
C Specification
To copy data between image objects, call:
// Provided by VK_VERSION_1_3
void vkCmdCopyImage2(
VkCommandBuffer commandBuffer,
const VkCopyImageInfo2* pCopyImageInfo);
// Provided by VK_KHR_copy_commands2
// Equivalent to vkCmdCopyImage2
void vkCmdCopyImage2KHR(
VkCommandBuffer commandBuffer,
const VkCopyImageInfo2* pCopyImageInfo);
Parameters
-
commandBufferis the command buffer into which the command will be recorded. -
pCopyImageInfois a pointer to a VkCopyImageInfo2 structure describing the copy parameters.
Description
This command is functionally identical to vkCmdCopyImage, but includes
extensible sub-structures that include sType and pNext
parameters, allowing them to be more easily extended.
-
VUID-vkCmdCopyImage2-commandBuffer-01825
IfcommandBufferis an unprotected command buffer andprotectedNoFaultis not supported,srcImagemust not be a protected image -
VUID-vkCmdCopyImage2-commandBuffer-01826
IfcommandBufferis an unprotected command buffer andprotectedNoFaultis not supported,dstImagemust not be a protected image -
VUID-vkCmdCopyImage2-commandBuffer-01827
IfcommandBufferis a protected command buffer andprotectedNoFaultis not supported,dstImagemust not be an unprotected image -
VUID-vkCmdCopyImage2-commandBuffer-10217
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT, and themaintenance10feature is not enabled, for each element ofpCopyImageInfo->pRegions, where theaspectMaskmember ofsrcSubresourceis VK_IMAGE_ASPECT_COLOR_BIT, theaspectMaskofdstSubresourcemust not be VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT -
VUID-vkCmdCopyImage2-commandBuffer-11782
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT but does support VK_QUEUE_COMPUTE_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofsrcSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofdstSubresourceis VK_IMAGE_ASPECT_DEPTH_BIT, then the format features ofdstImagemust contain VK_FORMAT_FEATURE_2_DEPTH_COPY_ON_COMPUTE_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-11783
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT and VK_QUEUE_COMPUTE_BIT, but does support VK_QUEUE_TRANSFER_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofsrcSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofdstSubresourceis VK_IMAGE_ASPECT_DEPTH_BIT, then the format features ofdstImagemust contain VK_FORMAT_FEATURE_2_DEPTH_COPY_ON_TRANSFER_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-11784
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT but does support VK_QUEUE_COMPUTE_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofsrcSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofdstSubresourceis VK_IMAGE_ASPECT_STENCIL_BIT, then the format features ofdstImagemust contain VK_FORMAT_FEATURE_2_STENCIL_COPY_ON_COMPUTE_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-11785
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT and VK_QUEUE_COMPUTE_BIT, but does support VK_QUEUE_TRANSFER_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofsrcSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofdstSubresourceis VK_IMAGE_ASPECT_STENCIL_BIT, then the format features ofdstImagemust contain VK_FORMAT_FEATURE_2_STENCIL_COPY_ON_TRANSFER_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-12449
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT andsrcSubresource.aspectMaskordstSubresource.aspectMaskof any element ofpCopyImageInfo->pRegionscontain VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT, then bothsrcImageanddstImagemust have a sample count equal to VK_SAMPLE_COUNT_1_BIT -
VUID-vkCmdCopyImage2-commandBuffer-10218
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT, and themaintenance10feature is not enabled, for each element ofpCopyImageInfo->pRegions, where theaspectMaskmember ofdstSubresourceis VK_IMAGE_ASPECT_COLOR_BIT then theaspectMaskofsrcSubresourcemust not be VK_IMAGE_ASPECT_DEPTH_BIT or VK_IMAGE_ASPECT_STENCIL_BIT -
VUID-vkCmdCopyImage2-commandBuffer-11786
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT but does support VK_QUEUE_COMPUTE_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofdstSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofsrcSubresourceis VK_IMAGE_ASPECT_DEPTH_BIT, then the format features ofsrcImagemust contain VK_FORMAT_FEATURE_2_DEPTH_COPY_ON_COMPUTE_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-11787
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT and VK_QUEUE_COMPUTE_BIT, but does support VK_QUEUE_TRANSFER_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofdstSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofsrcSubresourceis VK_IMAGE_ASPECT_DEPTH_BIT, then the format features ofsrcImagemust contain VK_FORMAT_FEATURE_2_DEPTH_COPY_ON_TRANSFER_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-11788
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT but does support VK_QUEUE_COMPUTE_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofdstSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofsrcSubresourceis VK_IMAGE_ASPECT_STENCIL_BIT, then the format features ofsrcImagemust contain VK_FORMAT_FEATURE_2_STENCIL_COPY_ON_COMPUTE_QUEUE_BIT_KHR -
VUID-vkCmdCopyImage2-commandBuffer-11789
If the queue family used to create the VkCommandPool whichcommandBufferwas allocated from does not support VK_QUEUE_GRAPHICS_BIT and VK_QUEUE_COMPUTE_BIT, but does support VK_QUEUE_TRANSFER_BIT, and in any element ofpCopyImageInfo->pRegionstheaspectMaskmember ofdstSubresourceis VK_IMAGE_ASPECT_COLOR_BIT and theaspectMaskofsrcSubresourceis VK_IMAGE_ASPECT_STENCIL_BIT, then the format features ofsrcImagemust contain VK_FORMAT_FEATURE_2_STENCIL_COPY_ON_TRANSFER_QUEUE_BIT_KHR
-
VUID-vkCmdCopyImage2-commandBuffer-parameter
commandBuffermust be a valid VkCommandBuffer handle -
VUID-vkCmdCopyImage2-pCopyImageInfo-parameter
pCopyImageInfomust be a valid pointer to a valid VkCopyImageInfo2 structure -
VUID-vkCmdCopyImage2-commandBuffer-recording
commandBuffermust be in the recording state -
VUID-vkCmdCopyImage2-commandBuffer-cmdpool
TheVkCommandPoolthatcommandBufferwas allocated from must support VK_QUEUE_COMPUTE_BIT, VK_QUEUE_GRAPHICS_BIT, or VK_QUEUE_TRANSFER_BIT operations -
VUID-vkCmdCopyImage2-renderpass
This command must only be called outside of a render pass instance -
VUID-vkCmdCopyImage2-suspended
This command must not be called between suspended render pass instances -
VUID-vkCmdCopyImage2-videocoding
This command must only be called outside of a video coding scope
-
Host access to
commandBuffermust be externally synchronized -
Host access to the
VkCommandPoolthatcommandBufferwas allocated from must be externally synchronized
| Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
|---|---|---|---|---|
Primary |
Outside |
Outside |
VK_QUEUE_COMPUTE_BIT |
Action |
vkCmdCopyImage2 is not affected by conditional rendering
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.