VkImageViewSlicedCreateInfoEXT
The range of 3D slices for the created image view can be restricted to a
subset of the parent image’s Z range by adding a
VkImageViewSlicedCreateInfoEXT structure to the pNext chain of
VkImageViewCreateInfo.
The VkImageViewSlicedCreateInfoEXT structure is defined as:
typedef struct VkImageViewSlicedCreateInfoEXT {
VkStructureType sType;
const void* pNext;
uint32_t sliceOffset;
uint32_t sliceCount;
} VkImageViewSlicedCreateInfoEXT;
sTypeis a VkStructureType value identifying this structure.pNextisNULLor a pointer to a structure extending this structure.sliceOffsetis the Z-offset for the first 3D slice accessible to the image view.sliceCountis the number of 3D slices accessible to the image view.
When this structure is chained to VkImageViewCreateInfo the
sliceOffset field is treated as a Z-offset for the sliced view and
sliceCount specifies the range.
Shader accesses using a Z coordinate of 0 will access the depth slice
corresponding to sliceOffset in the image, and in a shader, the
maximum in-bounds Z coordinate for the view is sliceCount - 1.
A sliced 3D view must only be used with a single mip level.
The slice coordinates are integer coordinates within the
subresourceRange.baseMipLevel used to create the image view.
The effective view depth is equal to extent.depth used to create the
image for this view adjusted by subresourceRange.baseMipLevel as
specified in Image Mip Level Sizing.
Shader access to this image view is only affected by
VkImageViewSlicedCreateInfoEXT if it uses a descriptor of type
VK_DESCRIPTOR_TYPE_STORAGE_IMAGE.
For access using any other descriptor type, the contents of
VkImageViewSlicedCreateInfoEXT are ignored; instead, sliceOffset
is treated as being equal to 0, and sliceCount is treated as being
equal to VK_REMAINING_3D_SLICES_EXT.
Valid Usage
VUID-VkImageViewSlicedCreateInfoEXT-sliceOffset-07867
sliceOffset must be less than the effective view depth as
specified in Image Mip Level Sizing
VUID-VkImageViewSlicedCreateInfoEXT-sliceCount-07868
If sliceCount is not VK_REMAINING_3D_SLICES_EXT, it must be
non-zero and sliceOffset + sliceCount must be
less than or equal to the effective view depth as specified in
Image Mip Level Sizing
VUID-VkImageViewSlicedCreateInfoEXT-image-07869
image must have been created with imageType equal to
VK_IMAGE_TYPE_3D
VUID-VkImageViewSlicedCreateInfoEXT-viewType-07909
viewType must be VK_IMAGE_VIEW_TYPE_3D
VUID-VkImageViewSlicedCreateInfoEXT-None-07870
The image view must reference exactly 1 mip level
VUID-VkImageViewSlicedCreateInfoEXT-None-07871
The imageSlicedViewOf3D feature must be enabled
Valid Usage (Implicit)
VUID-VkImageViewSlicedCreateInfoEXT-sType-sType
sType must be VK_STRUCTURE_TYPE_IMAGE_VIEW_SLICED_CREATE_INFO_EXT