// Copyright 2023-2024 The Khronos Group Inc. // // SPDX-License-Identifier: CC-BY-4.0 // Common Valid Usage // Common to VkImageMemoryBarrier* structs * [[VUID-{refpage}-subresourceRange-01486]] pname:subresourceRange.baseMipLevel must: be less than the pname:mipLevels specified in slink:VkImageCreateInfo when pname:image was created * [[VUID-{refpage}-subresourceRange-01724]] If pname:subresourceRange.levelCount is not ename:VK_REMAINING_MIP_LEVELS, [eq]#pname:subresourceRange.baseMipLevel {plus} pname:subresourceRange.levelCount# must: be less than or equal to the pname:mipLevels specified in slink:VkImageCreateInfo when pname:image was created * [[VUID-{refpage}-subresourceRange-01488]] pname:subresourceRange.baseArrayLayer must: be less than the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created * [[VUID-{refpage}-subresourceRange-01725]] If pname:subresourceRange.layerCount is not ename:VK_REMAINING_ARRAY_LAYERS, [eq]#pname:subresourceRange.baseArrayLayer {plus} pname:subresourceRange.layerCount# must: be less than or equal to the pname:arrayLayers specified in slink:VkImageCreateInfo when pname:image was created * [[VUID-{refpage}-image-01932]] If pname:image is non-sparse then it must: be bound completely and contiguously to a single sname:VkDeviceMemory object * [[VUID-{refpage}-image-09241]] If pname:image has a color format ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] that is single-plane, endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] then the pname:aspectMask member of pname:subresourceRange must: be ename:VK_IMAGE_ASPECT_COLOR_BIT ifdef::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] * [[VUID-{refpage}-image-09242]] If pname:image has a color format and is not _disjoint_, then the pname:aspectMask member of pname:subresourceRange must: be ename:VK_IMAGE_ASPECT_COLOR_BIT * [[VUID-{refpage}-image-01672]] If pname:image has a multi-planar format and the image is _disjoint_, then the pname:aspectMask member of pname:subresourceRange must: include at least one <> bit or ename:VK_IMAGE_ASPECT_COLOR_BIT endif::VK_VERSION_1_1,VK_KHR_sampler_ycbcr_conversion[] * [[VUID-{refpage}-image-03320]] If pname:image has a depth/stencil format with both depth and stencil ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] and the <> feature is not enabled, endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] then the pname:aspectMask member of pname:subresourceRange must: include both ename:VK_IMAGE_ASPECT_DEPTH_BIT and ename:VK_IMAGE_ASPECT_STENCIL_BIT ifdef::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] * [[VUID-{refpage}-image-03319]] If pname:image has a depth/stencil format with both depth and stencil and the <> feature is enabled, then the pname:aspectMask member of pname:subresourceRange must: include either or both ename:VK_IMAGE_ASPECT_DEPTH_BIT and ename:VK_IMAGE_ASPECT_STENCIL_BIT * [[VUID-{refpage}-aspectMask-08702]] If the pname:aspectMask member of pname:subresourceRange includes ename:VK_IMAGE_ASPECT_DEPTH_BIT, pname:oldLayout and pname:newLayout must: not be one of ename:VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or ename:VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL * [[VUID-{refpage}-aspectMask-08703]] If the pname:aspectMask member of pname:subresourceRange includes ename:VK_IMAGE_ASPECT_STENCIL_BIT, pname:oldLayout and pname:newLayout must: not be one of ename:VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or ename:VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL endif::VK_VERSION_1_2,VK_KHR_separate_depth_stencil_layouts[] // Common Valid Usage