// Copyright 2020-2021 The Khronos Group Inc.
//
// SPDX-License-Identifier: CC-BY-4.0

// Common Valid Usage
// Common to VkCmdCopyImageToBuffer* commands
  * [[VUID-{refpage}-pRegions-00183]]
    pname:dstBuffer must: be large enough to contain all buffer locations
    that are accessed according to <<copies-buffers-images-addressing,Buffer
    and Image Addressing>>, for each element of pname:pRegions
  * [[VUID-{refpage}-pRegions-00184]]
    The union of all source regions, and the union of all destination
    regions, specified by the elements of pname:pRegions, must: not overlap
    in memory
  * [[VUID-{refpage}-srcImage-00186]]
    pname:srcImage must: have been created with
    ename:VK_IMAGE_USAGE_TRANSFER_SRC_BIT usage flag
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-{refpage}-srcImage-01998]]
    The <<resources-image-format-features,format features>> of
    pname:srcImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_SRC_BIT
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-{refpage}-srcImage-00187]]
    If pname:srcImage is non-sparse then it must: be bound completely and
    contiguously to a single sname:VkDeviceMemory object
  * [[VUID-{refpage}-dstBuffer-00191]]
    pname:dstBuffer must: have been created with
    ename:VK_BUFFER_USAGE_TRANSFER_DST_BIT usage flag
  * [[VUID-{refpage}-dstBuffer-00192]]
    If pname:dstBuffer is non-sparse then it must: be bound completely and
    contiguously to a single sname:VkDeviceMemory object
  * [[VUID-{refpage}-srcImage-00188]]
    pname:srcImage must: have a sample count equal to
    ename:VK_SAMPLE_COUNT_1_BIT
  * [[VUID-{refpage}-srcImageLayout-00189]]
    pname:srcImageLayout must: specify the layout of the image subresources
    of pname:srcImage specified in pname:pRegions at the time this command
    is executed on a sname:VkDevice
ifndef::VK_KHR_shared_presentable_image[]
  * [[VUID-{refpage}-srcImageLayout-00190]]
    pname:srcImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
    or ename:VK_IMAGE_LAYOUT_GENERAL
endif::VK_KHR_shared_presentable_image[]
ifdef::VK_KHR_shared_presentable_image[]
  * [[VUID-{refpage}-srcImageLayout-01397]]
    pname:srcImageLayout must: be
    ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_GENERAL, or
    ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
endif::VK_KHR_shared_presentable_image[]
  * [[VUID-{refpage}-imageSubresource-01703]]
    The pname:imageSubresource.mipLevel member of each element of
    pname:pRegions must: be less than the pname:mipLevels specified in
    slink:VkImageCreateInfo when pname:srcImage was created
  * [[VUID-{refpage}-imageSubresource-01704]]
    The [eq]#pname:imageSubresource.baseArrayLayer {plus}
    pname:imageSubresource.layerCount# of each element of pname:pRegions
    must: be less than or equal to the pname:arrayLayers specified in
    slink:VkImageCreateInfo when pname:srcImage was created
  * [[VUID-{refpage}-imageOffset-01794]]
    The pname:imageOffset and pname:imageExtent members of each element of
    pname:pRegions must: respect the image transfer granularity requirements
    of pname:commandBuffer's command pool's queue family, as described in
    slink:VkQueueFamilyProperties
ifdef::VK_EXT_fragment_density_map[]
  * [[VUID-{refpage}-srcImage-02544]]
    pname:srcImage must: not have been created with pname:flags containing
    ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
endif::VK_EXT_fragment_density_map[]
// Common Valid Usage
