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

// Common Valid Usage
// Common to VkCmdResolveImage* commands
  * [[VUID-{refpage}-pRegions-00255]]
    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-00256]]
    If pname:srcImage is non-sparse then it must: be bound completely and
    contiguously to a single sname:VkDeviceMemory object
  * [[VUID-{refpage}-srcImage-00257]]
    pname:srcImage must: have a sample count equal to any valid sample count
    value other than ename:VK_SAMPLE_COUNT_1_BIT
  * [[VUID-{refpage}-dstImage-00258]]
    If pname:dstImage is non-sparse then it must: be bound completely and
    contiguously to a single sname:VkDeviceMemory object
  * [[VUID-{refpage}-dstImage-00259]]
    pname:dstImage must: have a sample count equal to
    ename:VK_SAMPLE_COUNT_1_BIT
  * [[VUID-{refpage}-srcImageLayout-00260]]
    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
  * [[VUID-{refpage}-srcImageLayout-01400]]
    pname:srcImageLayout must: be
ifdef::VK_KHR_shared_presentable_image[]
    ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
endif::VK_KHR_shared_presentable_image[]
    ename:VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_GENERAL
  * [[VUID-{refpage}-dstImageLayout-00262]]
    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
  * [[VUID-{refpage}-dstImageLayout-01401]]
    pname:dstImageLayout must: be
ifdef::VK_KHR_shared_presentable_image[]
    ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR,
endif::VK_KHR_shared_presentable_image[]
    ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL or
    ename:VK_IMAGE_LAYOUT_GENERAL
  * [[VUID-{refpage}-dstImage-02003]]
    The <<resources-image-format-features,format features>> of
    pname:dstImage must: contain
    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
ifdef::VK_NV_linear_color_attachment[]
  * [[VUID-{refpage}-linearColorAttachment-06519]]
    If the <<features-linearColorAttachment, pname:linearColorAttachment>>
    feature is enabled and the image is created with
    ename:VK_IMAGE_TILING_LINEAR, the
    <<resources-image-format-features,format features>> of pname:dstImage
    must: contain ename:VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV
endif::VK_NV_linear_color_attachment[]
  * [[VUID-{refpage}-srcImage-01386]]
    pname:srcImage and pname:dstImage must: have been created with the same
    image format
  * [[VUID-{refpage}-srcSubresource-01709]]
    The pname:srcSubresource.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}-dstSubresource-01710]]
    The pname:dstSubresource.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}-srcSubresource-01711]]
ifdef::VK_KHR_maintenance5[]
    If pname:srcSubresource.layerCount is not
    ename:VK_REMAINING_ARRAY_LAYERS,
endif::VK_KHR_maintenance5[]
    [eq]#pname:srcSubresource.baseArrayLayer {plus}
    pname:srcSubresource.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}-dstSubresource-01712]]
ifdef::VK_KHR_maintenance5[]
    If pname:dstSubresource.layerCount is not
    ename:VK_REMAINING_ARRAY_LAYERS,
endif::VK_KHR_maintenance5[]
    [eq]#pname:dstSubresource.baseArrayLayer {plus}
    pname:dstSubresource.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
ifdef::VK_EXT_fragment_density_map[]
  * [[VUID-{refpage}-dstImage-02546]]
    pname:dstImage and pname:srcImage must: not have been created with
    pname:flags containing ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT
endif::VK_EXT_fragment_density_map[]
  * [[VUID-{refpage}-srcImage-04446]]
    If pname:dstImage is of type ename:VK_IMAGE_TYPE_3D, then for each
    element of pname:pRegions, pname:srcSubresource.layerCount must: be `1`
  * [[VUID-{refpage}-srcImage-04447]]
    If pname:dstImage is of type ename:VK_IMAGE_TYPE_3D, then for each
    element of pname:pRegions, pname:dstSubresource.baseArrayLayer must: be
    `0` and pname:dstSubresource.layerCount must: be `1`
  * [[VUID-{refpage}-srcOffset-00269]]
    For each element of pname:pRegions, pname:srcOffset.x and
    [eq]#(pname:extent.width {plus} pname:srcOffset.x)# must: both be
    greater than or equal to `0` and less than or equal to the width of the
    specified pname:srcSubresource of pname:srcImage
  * [[VUID-{refpage}-srcOffset-00270]]
    For each element of pname:pRegions, pname:srcOffset.y and
    [eq]#(pname:extent.height {plus} pname:srcOffset.y)# must: both be
    greater than or equal to `0` and less than or equal to the height of the
    specified pname:srcSubresource of pname:srcImage
  * [[VUID-{refpage}-srcImage-00271]]
    If pname:srcImage is of type ename:VK_IMAGE_TYPE_1D, then for each
    element of pname:pRegions, pname:srcOffset.y must: be `0` and
    pname:extent.height must: be `1`
  * [[VUID-{refpage}-srcOffset-00272]]
    For each element of pname:pRegions, pname:srcOffset.z and
    [eq]#(pname:extent.depth {plus} pname:srcOffset.z)# must: both be
    greater than or equal to `0` and less than or equal to the depth of the
    specified pname:srcSubresource of pname:srcImage
  * [[VUID-{refpage}-srcImage-00273]]
    If pname:srcImage is of type ename:VK_IMAGE_TYPE_1D or
    ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions,
    pname:srcOffset.z must: be `0` and pname:extent.depth must: be `1`
  * [[VUID-{refpage}-dstOffset-00274]]
    For each element of pname:pRegions, pname:dstOffset.x and
    [eq]#(pname:extent.width {plus} pname:dstOffset.x)# must: both be
    greater than or equal to `0` and less than or equal to the width of the
    specified pname:dstSubresource of pname:dstImage
  * [[VUID-{refpage}-dstOffset-00275]]
    For each element of pname:pRegions, pname:dstOffset.y and
    [eq]#(pname:extent.height {plus} pname:dstOffset.y)# must: both be
    greater than or equal to `0` and less than or equal to the height of the
    specified pname:dstSubresource of pname:dstImage
  * [[VUID-{refpage}-dstImage-00276]]
    If pname:dstImage is of type ename:VK_IMAGE_TYPE_1D, then for each
    element of pname:pRegions, pname:dstOffset.y must: be `0` and
    pname:extent.height must: be `1`
  * [[VUID-{refpage}-dstOffset-00277]]
    For each element of pname:pRegions, pname:dstOffset.z and
    [eq]#(pname:extent.depth {plus} pname:dstOffset.z)# must: both be
    greater than or equal to `0` and less than or equal to the depth of the
    specified pname:dstSubresource of pname:dstImage
  * [[VUID-{refpage}-dstImage-00278]]
    If pname:dstImage is of type ename:VK_IMAGE_TYPE_1D or
    ename:VK_IMAGE_TYPE_2D, then for each element of pname:pRegions,
    pname:dstOffset.z must: be `0` and pname:extent.depth must: be `1`
  * [[VUID-{refpage}-srcImage-06762]]
    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-06763]]
    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}-dstImage-06764]]
    pname:dstImage must: have been created with
    ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag
ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
  * [[VUID-{refpage}-dstImage-06765]]
    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[]
// Common Valid Usage
