1// Copyright 2020-2021 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5// Common Valid Usage 6// Common to VkCmdCopyBufferToImage* commands 7 * [[VUID-{refpage}-pRegions-00171]] 8 pname:srcBuffer must: be large enough to contain all buffer locations 9 that are accessed according to <<copies-buffers-images-addressing,Buffer 10 and Image Addressing>>, for each element of pname:pRegions 11 * [[VUID-{refpage}-pRegions-00173]] 12 The union of all source regions, and the union of all destination 13 regions, specified by the elements of pname:pRegions, must: not overlap 14 in memory 15 * [[VUID-{refpage}-srcBuffer-00174]] 16 pname:srcBuffer must: have been created with 17 ename:VK_BUFFER_USAGE_TRANSFER_SRC_BIT usage flag 18ifdef::VK_VERSION_1_1,VK_KHR_maintenance1[] 19 * [[VUID-{refpage}-dstImage-01997]] 20 The <<resources-image-format-features,format features>> of 21 pname:dstImage must: contain ename:VK_FORMAT_FEATURE_TRANSFER_DST_BIT 22endif::VK_VERSION_1_1,VK_KHR_maintenance1[] 23 * [[VUID-{refpage}-srcBuffer-00176]] 24 If pname:srcBuffer is non-sparse then it must: be bound completely and 25 contiguously to a single sname:VkDeviceMemory object 26 * [[VUID-{refpage}-dstImage-00177]] 27 pname:dstImage must: have been created with 28 ename:VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag 29 * [[VUID-{refpage}-dstImage-00178]] 30 If pname:dstImage is non-sparse then it must: be bound completely and 31 contiguously to a single sname:VkDeviceMemory object 32 * [[VUID-{refpage}-dstImage-00179]] 33 pname:dstImage must: have a sample count equal to 34 ename:VK_SAMPLE_COUNT_1_BIT 35 * [[VUID-{refpage}-dstImageLayout-00180]] 36 pname:dstImageLayout must: specify the layout of the image subresources 37 of pname:dstImage specified in pname:pRegions at the time this command 38 is executed on a sname:VkDevice 39ifndef::VK_KHR_shared_presentable_image[] 40 * [[VUID-{refpage}-dstImageLayout-00181]] 41 pname:dstImageLayout must: be ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL 42 or ename:VK_IMAGE_LAYOUT_GENERAL 43endif::VK_KHR_shared_presentable_image[] 44ifdef::VK_KHR_shared_presentable_image[] 45 * [[VUID-{refpage}-dstImageLayout-01396]] 46 pname:dstImageLayout must: be 47 ename:VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 48 ename:VK_IMAGE_LAYOUT_GENERAL, or 49 ename:VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR 50endif::VK_KHR_shared_presentable_image[] 51 * [[VUID-{refpage}-imageSubresource-01701]] 52 The pname:imageSubresource.mipLevel member of each element of 53 pname:pRegions must: be less than the pname:mipLevels specified in 54 slink:VkImageCreateInfo when pname:dstImage was created 55 * [[VUID-{refpage}-imageSubresource-01702]] 56 The [eq]#pname:imageSubresource.baseArrayLayer {plus} 57 pname:imageSubresource.layerCount# of each element of pname:pRegions 58 must: be less than or equal to the pname:arrayLayers specified in 59 slink:VkImageCreateInfo when pname:dstImage was created 60 * [[VUID-{refpage}-imageOffset-01793]] 61 The pname:imageOffset and pname:imageExtent members of each element of 62 pname:pRegions must: respect the image transfer granularity requirements 63 of pname:commandBuffer's command pool's queue family, as described in 64 slink:VkQueueFamilyProperties 65ifdef::VK_EXT_fragment_density_map[] 66 * [[VUID-{refpage}-dstImage-02543]] 67 pname:dstImage must: not have been created with pname:flags containing 68 ename:VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT 69endif::VK_EXT_fragment_density_map[] 70ifndef::VK_EXT_depth_range_unrestricted[] 71 * [[VUID-{refpage}-None-00214]] 72 For each element of pname:pRegions whose pname:imageSubresource contains 73 a depth aspect, the data in pname:srcBuffer must: be in the range 74 [eq]#[0,1]# 75endif::VK_EXT_depth_range_unrestricted[] 76 * [[VUID-{refpage}-commandBuffer-04477]] 77 If the queue family used to create the slink:VkCommandPool which 78 pname:commandBuffer was allocated from does not support 79 ename:VK_QUEUE_GRAPHICS_BIT, for each element of pname:pRegions, the 80 pname:aspectMask member of pname:imageSubresource must: not be 81 ename:VK_IMAGE_ASPECT_DEPTH_BIT or ename:VK_IMAGE_ASPECT_STENCIL_BIT 82// Common Valid Usage 83