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

// Common Valid Usage
// Common to VkCmdCopyBufferToImage* commands
  * [[VUID-{refpage}-pRegions-00171]]
    pname:srcBuffer 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-00173]]
    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}-srcBuffer-00174]]
    pname:srcBuffer must: have been created with
    ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-{refpage}-dstImage-01997]]
    The <<resources-image-format-features,format features>> of
    pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT
endif::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-{refpage}-srcBuffer-00176]]
    If pname:srcBuffer is non-sparse then it must: be bound completely and
    contiguously to a single sname:VkDeviceMemory object
  * [[VUID-{refpage}-dstImage-00177]]
    pname:dstImage must: have been created with
    ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
  * [[VUID-{refpage}-dstImage-00178]]
    If pname:dstImage is non-sparse then it must: be bound completely and
    contiguously to a single sname:VkDeviceMemory object
  * [[VUID-{refpage}-dstImage-00179]]
    pname:dstImage must: have a sample count equal to
    ename:VK_SAMPLE_COUNT_1_BIT
  * [[VUID-{refpage}-dstImageLayout-00180]]
    pname:dstImageLayout must: specify the layout of the image subresources
    of pname:dstImage specified in pname:pRegions at the time this command
    is executed on a sname:VkDevice
ifndef::VK_KHR_shared_presentable_image[]
  * [[VUID-{refpage}-dstImageLayout-00181]]
    pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL
    or ename:VK_IMAGE_LAYOUT_GENERAL
endif::VK_KHR_shared_presentable_image[]
ifdef::VK_KHR_shared_presentable_image[]
  * [[VUID-{refpage}-dstImageLayout-01396]]
    pname:dstImageLayout must: be
    ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
    ename:VK_IMAGE_LAYOUT_GENERAL, or
    ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR
endif::VK_KHR_shared_presentable_image[]
  * [[VUID-{refpage}-imageSubresource-01701]]
    The pname:imageSubresource.mipLevel member of each element of
    pname:pRegions must: be less than the pname:mipLevels specified in
    slink:VkImageCreateInfo when pname:dstImage was created
  * [[VUID-{refpage}-imageSubresource-01702]]
    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:dstImage was created
  * [[VUID-{refpage}-imageOffset-01793]]
    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}-dstImage-02543]]
    pname:dstImage must: not have been created with pname:flags containing
    ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
endif::VK_EXT_fragment_density_map[]
ifndef::VK_EXT_depth_range_unrestricted[]
  * [[VUID-{refpage}-None-00214]]
    For each element of pname:pRegions whose pname:imageSubresource contains
    a depth aspect, the data in pname:srcBuffer must: be in the range
    [eq]#[0,1]#
endif::VK_EXT_depth_range_unrestricted[]
  * [[VUID-{refpage}-commandBuffer-04477]]
    If the queue family used to create the slink:VkCommandPool which
    pname:commandBuffer was allocated from does not support
    ename:VK_QUEUE_GRAPHICS_BIT, for each element of pname:pRegions, the
    pname:aspectMask member of pname:imageSubresource must: not be
    ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT.
// Common Valid Usage
