VkImageViewCreateInfo - Structure specifying parameters of a newly
created image view
Views of compatible formats will have the same mapping between texel
coordinates and memory locations irrespective of the format, with only
the interpretation of the bit pattern changing.
If the
imageCubeArray
feature is not enabled, viewType must not be
IMAGE_VIEW_TYPE_CUBE_ARRAY
If image was created with
IMAGE_TYPE_3D but without
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
set then viewType must not be
IMAGE_VIEW_TYPE_2D_ARRAY
If image was created with
IMAGE_TYPE_3D but without
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
or
IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT
set, then viewType must not be
IMAGE_VIEW_TYPE_2D
If image was created with
IMAGE_TYPE_3D and viewType is
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY then
subresourceRange.levelCount must be 1
If image was created with
a samples value not equal to
SAMPLE_COUNT_1_BIT then
viewType must be either
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY
image must have been
created with a usage value containing at least one of the
following:
The
format features
of the resultant image view must contain at least one bit
If usage contains
IMAGE_USAGE_SAMPLED_BIT,
then the
format features
of the resultant image view must contain
FORMAT_FEATURE_SAMPLED_IMAGE_BIT
If usage contains
IMAGE_USAGE_STORAGE_BIT,
then the image view’s
format features
must contain
FORMAT_FEATURE_STORAGE_IMAGE_BIT
If usage contains
IMAGE_USAGE_COLOR_ATTACHMENT_BIT,
then the image view’s
format features
must contain
FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
or
FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV
If usage contains
IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
then the image view’s
format features
must contain
FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
If usage contains
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR,
then the image view’s
format features
must contain
VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR
If usage contains
VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR,
then the image view’s
format features
must contain
VK_FORMAT_FEATURE_VIDEO_DECODE_DPB_BIT_KHR
usage must not include
VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR
If usage contains
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR,
then the image view’s
format features
must contain
VK_FORMAT_FEATURE_VIDEO_ENCODE_INPUT_BIT_KHR
If usage contains
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR,
then the image view’s
format features
must contain
VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR
usage must not include
VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR
If usage contains
VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR,
then the image view’s
format features
must contain
VK_FORMAT_FEATURE_2_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR
If usage contains
VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR,
then the image view’s
format features
must contain
VK_FORMAT_FEATURE_2_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR
If usage contains
IMAGE_USAGE_INPUT_ATTACHMENT_BIT,
and any of the following is true:
subresourceRange.baseMipLevel must be less than the mipLevels
specified in ImageCreateInfo when image was
created
If
subresourceRange.levelCount is not
REMAINING_MIP_LEVELS,
subresourceRange.baseMipLevel + subresourceRange.levelCount
must be less than or equal to the mipLevels specified in
ImageCreateInfo when image was created
If image was created with
the
IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT
usage flag set, subresourceRange.levelCount must be 1
If image is not a 3D
image created with
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
or
IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT
set, or viewType is not
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY,
subresourceRange.baseArrayLayer must be less than the
arrayLayers specified in ImageCreateInfo
when image was created
If
subresourceRange.layerCount is not
REMAINING_ARRAY_LAYERS, image is not
a 3D image created with
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
or
IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT
set, or viewType is not
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY,
subresourceRange.layerCount must be non-zero and
subresourceRange.baseArrayLayer + subresourceRange.layerCount
must be less than or equal to the arrayLayers specified in
ImageCreateInfo when image was created
If image is a 3D image
created with
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
set, and viewType is
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY,
subresourceRange.baseArrayLayer must be less than the depth
computed from baseMipLevel and extent.depth specified in
ImageCreateInfo when image was created,
according to the formula defined in
Image Mip Level Sizing
If
subresourceRange.layerCount is not
REMAINING_ARRAY_LAYERS, image is a 3D
image created with
IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT
set, and viewType is
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY,
subresourceRange.layerCount must be non-zero and
subresourceRange.baseArrayLayer + subresourceRange.layerCount
must be less than or equal to the depth computed from
baseMipLevel and extent.depth specified in
ImageCreateInfo when image was created,
according to the formula defined in
Image Mip Level Sizing
If image was created with
the
IMAGE_CREATE_MUTABLE_FORMAT_BIT
flag, but without the
IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
flag, and if the format of the image is not a
multi-planar format,
format must be compatible with the format used to create
image, as defined in
Format Compatibility Classes
If image was created with
the
IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
flag, format must be compatible with, or must be an
uncompressed format that is
size-compatible
with, the format used to create image
If image was created with
the
IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
flag and format is a non-compressed format, the levelCount
member of subresourceRange must be 1
If image was created with
the
IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
flag, the
PhysicalDeviceMaintenance6Properties::blockTexelViewCompatibleMultipleLayers
property is not TRUE, and format
is a non-compressed format, then the layerCount member of
subresourceRange must be 1
If a
ImageFormatListCreateInfo
structure was included in the pNext chain of the
ImageCreateInfo structure used when creating
image and
ImageFormatListCreateInfo::viewFormatCount
is not zero then format must be one of the formats in
ImageFormatListCreateInfo::pViewFormats
If image was created with
the
IMAGE_CREATE_MUTABLE_FORMAT_BIT
flag, if the format of the image is a
multi-planar format,
and if subresourceRange.aspectMask is one of the
multi-planar aspect mask
bits, then format must be compatible with the
Format for the plane of the image
format indicated by subresourceRange.aspectMask, as defined in
https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#formats-compatible-planes
subresourceRange.aspectMask must only have at most 1 valid
multi-planar aspect mask
bit
If image was not created
with the
IMAGE_CREATE_MUTABLE_FORMAT_BIT
flag format must be identical to the format used to create
image
If the format of the
image is a
multi-planar format
and subresourceRange.aspectMask is
IMAGE_ASPECT_COLOR_BIT,
format must be identical to the format used to create image
If the image view’s format
requires a sampler Y′CBCR conversion
and usage contains
IMAGE_USAGE_SAMPLED_BIT,
then the pNext chain must include a
SamplerYcbcrConversionInfo
structure with a conversion value other than
NULL_HANDLE
If format has a _422
or _420 suffix then image must have been created with a width
that is a multiple of 2
If format has a _420
suffix then image must have been created with a height that is a
multiple of 2
If the pNext chain
includes a
SamplerYcbcrConversionInfo
structure with a conversion value other than
NULL_HANDLE, all members of
components must have the
identity swizzle
If the pNext chain
includes a
SamplerYcbcrConversionInfo
structure with a conversion value other than
NULL_HANDLE, format must be the
same used in
SamplerYcbcrConversionCreateInfo::format
If image is non-sparse
then the image or each specified disjoint plane must be bound
completely and contiguously to a single
DeviceMemory object
viewType
must be compatible with the type of image as shown in the
view type compatibility table
If image has an
Android external format,
format must be FORMAT_UNDEFINED
If image has an
Android external format,
the pNext chain must include a
SamplerYcbcrConversionInfo
structure with a conversion object created with the same external
format as image
If image has an
Android external format,
all members of components must be the
identity swizzle
If image has an
QNX Screen external format,
format must be FORMAT_UNDEFINED
If image has an
QNX Screen external format,
the pNext chain must include a
SamplerYcbcrConversionInfo
structure with a conversion object created with the same external
format as image
If image has an
QNX Screen external format,
all members of components must be the
identity swizzle
If image was created with
the
IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
usage flag set, viewType must be
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY
If the
shadingRateImage
feature is enabled, and image was created with the
IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV
usage flag set, format must be
FORMAT_R8_UINT
If
the
attachmentFragmentShadingRate
feature is not enabled, the usage for the image view must not
contain
IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
If the usage for the
image view includes
IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
then the image view’s
format features
must contain
FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
If the usage for the
image view includes
IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
and
layeredShadingRateAttachments
is FALSE,
subresourceRange.layerCount must be 1
If the
fragmentDensityMapDynamic
feature is not enabled, flags must not contain
IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT
If the
fragmentDensityMapDeferred
feature is not enabled, flags must not contain
IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT
If flags contains
IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT,
flags must not contain
IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT
If image was created with
flags containing
IMAGE_CREATE_SUBSAMPLED_BIT_EXT
and the
IMAGE_USAGE_SAMPLED_BIT
usage flag set, subresourceRange.layerCount must be less than or
equal to
::maxSubsampledArrayLayers
If the
invocationMask
feature is enabled, and image was created with the
IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI
usage flag set, format must be
FORMAT_R8_UINT
If flags does not contain
IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT,
and image was created with the
IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT
usage flag set, its flags must not contain any of
IMAGE_CREATE_PROTECTED_BIT,
IMAGE_CREATE_SPARSE_BINDING_BIT,
IMAGE_CREATE_SPARSE_RESIDENCY_BIT,
or
IMAGE_CREATE_SPARSE_ALIASED_BIT
If the pNext chain
includes a
ImageViewUsageCreateInfo
structure, and image was not created with a
ImageStencilUsageCreateInfo
structure included in the pNext chain of
ImageCreateInfo, its usage member must not
include any bits that were not set in the usage member of the
ImageCreateInfo structure used to create
image
If the pNext chain
includes a
ImageViewUsageCreateInfo
structure, image was created with a
ImageStencilUsageCreateInfo
structure included in the pNext chain of
ImageCreateInfo, and
subresourceRange.aspectMask includes
IMAGE_ASPECT_STENCIL_BIT,
the usage member of the
ImageViewUsageCreateInfo
structure must not include any bits that were not set in the
usage member of the
ImageStencilUsageCreateInfo
structure used to create image
If the pNext chain
includes a
ImageViewUsageCreateInfo
structure, image was created with a
ImageStencilUsageCreateInfo
structure included in the pNext chain of
ImageCreateInfo, and
subresourceRange.aspectMask includes bits other than
IMAGE_ASPECT_STENCIL_BIT,
the usage member of the
ImageViewUsageCreateInfo
structure must not include any bits that were not set in the
usage member of the ImageCreateInfo
structure used to create image
If viewType is
IMAGE_VIEW_TYPE_1D,
IMAGE_VIEW_TYPE_2D, or
IMAGE_VIEW_TYPE_3D; and
subresourceRange.layerCount is not
REMAINING_ARRAY_LAYERS, then
subresourceRange.layerCount must be 1
If viewType is
IMAGE_VIEW_TYPE_1D,
IMAGE_VIEW_TYPE_2D, or
IMAGE_VIEW_TYPE_3D; and
subresourceRange.layerCount is
REMAINING_ARRAY_LAYERS, then the
remaining number of layers must be 1
If viewType is
IMAGE_VIEW_TYPE_CUBE and
subresourceRange.layerCount is not
REMAINING_ARRAY_LAYERS,
subresourceRange.layerCount must be 6
If viewType is
IMAGE_VIEW_TYPE_CUBE_ARRAY and
subresourceRange.layerCount is not
REMAINING_ARRAY_LAYERS,
subresourceRange.layerCount must be a multiple of 6
If viewType is
IMAGE_VIEW_TYPE_CUBE and
subresourceRange.layerCount is
REMAINING_ARRAY_LAYERS, the remaining
number of layers must be 6
If viewType is
IMAGE_VIEW_TYPE_CUBE_ARRAY and
subresourceRange.layerCount is
REMAINING_ARRAY_LAYERS, the remaining
number of layers must be a multiple of 6
If the
VK_KHR_portability_subset extension is enabled, and
PhysicalDevicePortabilitySubsetFeaturesKHR::imageViewFormatSwizzle
is FALSE, all elements of
components must have the
identity swizzle
If the VK_KHR_portability_subset extension is enabled, and
PhysicalDevicePortabilitySubsetFeaturesKHR::imageViewFormatReinterpretation
is FALSE, the
Format in format must not contain a
different number of components, or a different number of bits in
each component, than the format of the Image
in image
If image was created with
the
VK_IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHR
usage flag set,
VK_IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHR,
or
VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR,
then the viewType must be
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY
If image was created with
the
VK_IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHR
usage flag set,
VK_IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHR,
or
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR,
then the viewType must be
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY
If image was created with
the
VK_IMAGE_USAGE_VIDEO_ENCODE_QUANTIZATION_DELTA_MAP_BIT_KHR
or
VK_IMAGE_USAGE_VIDEO_ENCODE_EMPHASIS_MAP_BIT_KHR
usage flags set, then viewType must be
IMAGE_VIEW_TYPE_2D or
IMAGE_VIEW_TYPE_2D_ARRAY
If flags includes
IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT,
the
descriptorBufferCaptureReplay
feature must be enabled
If the pNext chain
includes a
OpaqueCaptureDescriptorDataCreateInfoEXT
structure, flags must contain
IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT
If the pNext chain
includes a
ExportMetalObjectCreateInfoEXT
structure, its exportObjectType member must be
EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure, then
textureSampleWeighted
feature must be enabled
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure, then image must have been created with the
IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM
usage flag set
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure, then components must be
COMPONENT_SWIZZLE_IDENTITY
for all components
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure, then subresourceRange.aspectMask must be
IMAGE_ASPECT_COLOR_BIT
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure, then subresourceRange.levelCount must be 1
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure, then viewType must be
IMAGE_VIEW_TYPE_1D_ARRAY or
IMAGE_VIEW_TYPE_2D_ARRAY
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and if viewType is
IMAGE_VIEW_TYPE_1D_ARRAY, then
image must have been created with imageType
IMAGE_TYPE_1D
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and viewType is
IMAGE_VIEW_TYPE_1D_ARRAY, then
subresourceRange.layerCount must be equal to 2
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and viewType is
IMAGE_VIEW_TYPE_1D_ARRAY, then
image must have been created with width equal to or greater
than ((numPhases
times mathbin{max}left(
mathbin{align}left(filterSize.width,4right),
filterSize.heightright)))
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and if viewType is
IMAGE_VIEW_TYPE_2D_ARRAY, then
image must have been created with imageType
IMAGE_TYPE_2D
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and viewType is
IMAGE_VIEW_TYPE_2D_ARRAY, then
subresourceRange.layerCount must be equal or greater than
numPhases
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and viewType is
IMAGE_VIEW_TYPE_2D_ARRAY, then
image must have been created with width equal to or greater
than filterSize.width
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure and viewType is
IMAGE_VIEW_TYPE_2D_ARRAY, then
image must have been created with height equal to or greater
than filterSize.height
If the pNext chain
includes
ImageViewSampleWeightCreateInfoQCOM
structure then
ImageViewSampleWeightCreateInfoQCOM::filterSize.height
must be less than or equal to
::maxWeightFilterDimension.height
subresourceRange.aspectMask must be valid for the format the
image was created with
If image was created with
IMAGE_CREATE_ALIAS_SINGLE_LAYER_DESCRIPTOR_BIT_KHR,
format must not be a
multi-planar format
If Vulkan 1.3 is not
supported and the
ycbcr2plane444Formats
feature is not enabled, format must not be
FORMAT_G8_B8R8_2PLANE_444_UNORM,
FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16,
or FORMAT_G16_B16R16_2PLANE_444_UNORM