VKIMAGEVIEWCREATEINF(3)

NAME
VkImageViewCreateInfo - Structure specifying parameters of a newly created image view

C SPECIFICATION

The VkImageViewCreateInfo structure is defined as:

    typedef struct VkImageViewCreateInfo {
        VkStructureType            sType;
        const void*                pNext;
        VkImageViewCreateFlags     flags;
        VkImage                    image;
        VkImageViewType            viewType;
        VkFormat                   format;
        VkComponentMapping         components;
        VkImageSubresourceRange    subresourceRange;
    } VkImageViewCreateInfo;

MEMBERS

    • sType is the type of this structure.

    • pNext is NULL or a pointer to an extension-specific structure.

    • flags is reserved for future use.

    • image is a VkImage on which the view will be created.

    • viewType is the type of the image view.

    • format is a VkFormat describing the format and type used to interpret data elements in the image.

    • components specifies a remapping of color components (or of depth or stencil components after they have been converted into color components). See VkComponentMapping.

    • subresourceRange is a VkImageSubresourceRange selecting the set of mipmap levels and array layers to be accessible to the view.

DESCRIPTION

If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format can be different from the image’s format, but if they are not equal they must be compatible. Image format compatibility is defined in the Format Compatibility Classes section.

Table 1. Image and image view parameter compatibility requirements
Dim, Arrayed, MS | Image parameters | View parameters
 | imageType = ci.imageType width = ci.extent.width height = ci.extent.height depth = ci.extent.depth arrayLayers = ci.arrayLayers samples = ci.samples where ci is the VkImageCreateInfo used to create image. | baseArrayLayer and layerCount are members of the subresourceRange member.
1D, 0, 0 | imageType = VK_IMAGE_TYPE_1D width ≥ 1 height = 1 depth = 1 arrayLayers ≥ 1 samples = 1 | viewType = VK_VIEW_TYPE_1D baseArrayLayer ≥ 0 layerCount = 1
1D, 1, 0 | imageType = VK_IMAGE_TYPE_1D width ≥ 1 height = 1 depth = 1 arrayLayers ≥ 1 samples = 1 | viewType = VK_VIEW_TYPE_1D_ARRAY baseArrayLayer ≥ 0 layerCount ≥ 1
2D, 0, 0 | imageType = VK_IMAGE_TYPE_2D width ≥ 1 height ≥ 1 depth = 1 arrayLayers ≥ 1 samples = 1 | viewType = VK_VIEW_TYPE_2D baseArrayLayer ≥ 0 layerCount = 1
2D, 1, 0 | imageType = VK_IMAGE_TYPE_2D width ≥ 1 height ≥ 1 depth = 1 arrayLayers ≥ 1 samples = 1 | viewType = VK_VIEW_TYPE_2D_ARRAY baseArrayLayer ≥ 0 layerCount ≥ 1
2D, 0, 1 | imageType = VK_IMAGE_TYPE_2D width ≥ 1 height ≥ 1 depth = 1 arrayLayers ≥ 1 samples > 1 | viewType = VK_VIEW_TYPE_2D baseArrayLayer ≥ 0 layerCount = 1
2D, 1, 1 | imageType = VK_IMAGE_TYPE_2D width ≥ 1 height ≥ 1 depth = 1 arrayLayers ≥ 1 samples > 1 | viewType = VK_VIEW_TYPE_2D_ARRAY baseArrayLayer ≥ 0 layerCount ≥ 1
CUBE, 0, 0 | imageType = VK_IMAGE_TYPE_2D width ≥ 1 height = width depth = 1 arrayLayers ≥ 6 samples = 1 flags includes VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | viewType = VK_VIEW_TYPE_CUBE baseArrayLayer ≥ 0 layerCount = 6
CUBE, 1, 0 | imageType = VK_IMAGE_TYPE_2D width ≥ 1 height = width depth = 1 N ≥ 1 arrayLayers ≥ 6 × N samples = 1 flags includes VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT | viewType = VK_VIEW_TYPE_CUBE_ARRAY baseArrayLayer ≥ 0 layerCount = 6 × N, N ≥ 1
3D, 0, 0 | imageType = VK_IMAGE_TYPE_3D width ≥ 1 height ≥ 1 depth ≥ 1 arrayLayers = 1 samples = 1 | viewType = VK_VIEW_TYPE_3D baseArrayLayer = 0 layerCount = 1

Valid Usage

    • If image was not created with VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT then viewType must not be VK_IMAGE_VIEW_TYPE_CUBE or VK_IMAGE_VIEW_TYPE_CUBE_ARRAY

    • If the image cubemap arrays feature is not enabled, viewType must not be VK_IMAGE_VIEW_TYPE_CUBE_ARRAY

    • If the ETC2 texture compression feature is not enabled, format must not be VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_EAC_R11_UNORM_BLOCK, VK_FORMAT_EAC_R11_SNORM_BLOCK, VK_FORMAT_EAC_R11G11_UNORM_BLOCK, or VK_FORMAT_EAC_R11G11_SNORM_BLOCK

    • If the ASTC LDR texture compression feature is not enabled, format must not be VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_SRGB_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_SRGB_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_SRGB_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_SRGB_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_SRGB_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_SRGB_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_SRGB_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_SRGB_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_SRGB_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x10_SRGB_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_SRGB_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK, or VK_FORMAT_ASTC_12x12_SRGB_BLOCK

    • If the BC texture compression feature is not enabled, format must not be VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC3_SRGB_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, or VK_FORMAT_BC7_SRGB_BLOCK

    • If image was created with VK_IMAGE_TILING_LINEAR, format must be format that has at least one supported feature bit present in the value of VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_LINEAR and usage containing VK_IMAGE_USAGE_SAMPLED_BIT, format must be supported for sampled images, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_LINEAR and usage containing VK_IMAGE_USAGE_STORAGE_BIT, format must be supported for storage images, as specified by the VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_LINEAR and usage containing VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, format must be supported for color attachments, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_LINEAR and usage containing VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, format must be supported for depth/stencil attachments, as specified by the VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in VkFormatProperties::linearTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_OPTIMAL, format must be format that has at least one supported feature bit present in the value of VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_OPTIMAL and usage containing VK_IMAGE_USAGE_SAMPLED_BIT, format must be supported for sampled images, as specified by the VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_OPTIMAL and usage containing VK_IMAGE_USAGE_STORAGE_BIT, format must be supported for storage images, as specified by the VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_OPTIMAL and usage containing VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, format must be supported for color attachments, as specified by the VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • If image was created with VK_IMAGE_TILING_OPTIMAL and usage containing VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, format must be supported for depth/stencil attachments, as specified by the VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT flag in VkFormatProperties::optimalTilingFeatures returned by vkGetPhysicalDeviceFormatProperties with the same value of format

    • subresourceRange must be a valid image subresource range for image (see ???)

    • If image was created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be compatible with the format used to create image, as defined in Format Compatibility Classes

    • If image was not created with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, format must be identical to the format used to create image

    • If image is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory object

    • subResourceRange and viewType must be compatible with the image, as described in the compatibility table
Valid Usage (Implicit)

    • sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO

    • pNext must be NULL

    • flags must be 0

    • image must be a valid VkImage handle

    • viewType must be a valid VkImageViewType value

    • format must be a valid VkFormat value

    • components must be a valid VkComponentMapping structure

    • subresourceRange must be a valid VkImageSubresourceRange structure

SEE ALSO

VkComponentMapping, VkFormat, VkImage, VkImageSubresourceRange, VkImageViewCreateFlags, VkImageViewType, VkStructureType, vkCreateImageView

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#VkImageViewCreateInfo

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.