Top Description Inners Fields Constructors Methods
org.lwjgl.vulkan

public Class VkImageViewCreateInfo

extends Struct<VkImageViewCreateInfo>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Structure specifying parameters of a newly created image view.
Description

Some of the image creation parameters are inherited by the view. In particular, image view creation inherits the implicit parameter usage specifying the allowed usages of the image view that, by default, takes the value of the corresponding usage parameter specified in VkImageCreateInfo at image creation time. The implicit usage can be overridden by adding a VkImageViewUsageCreateInfo structure to the pNext chain, but the view usage must be a subset of the image usage. If image has a depth-stencil format and was created with a VkImageStencilUsageCreateInfo structure included in the pNext chain of VkImageCreateInfo, the usage is calculated based on the subresource.aspectMask provided:

If image is a 3D image, its Z range can be restricted to a subset by adding a VkImageViewSlicedCreateInfoEXT to the pNext chain.

If image was created with the IMAGE_CREATE_MUTABLE_FORMAT_BIT flag, and if the format of the image is not multi-planar, format can be different from the image’s format, but if image was created without the IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and they are not equal they must be compatible. Image format compatibility is defined in the Format Compatibility Classes section. 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 image was created with a multi-planar format, and the image view’s aspectMask is one of IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT or IMAGE_ASPECT_PLANE_2_BIT, the view’s aspect mask is considered to be equivalent to IMAGE_ASPECT_COLOR_BIT when used as a framebuffer attachment.

Note

Values intended to be used with one view format may not be exactly preserved when written or read through a different format. For example, an integer value that happens to have the bit pattern of a floating point denorm or NaN may be flushed or canonicalized when written or read through a view with a floating point format. Similarly, a value written through a signed normalized format that has a bit pattern exactly equal to -2b may be changed to -2b + 1 as described in Conversion from Normalized Fixed-Point to Floating-Point.

If image was created with the IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag, format must be compatible with the image’s format as described above; or must be an uncompressed format, in which case it must be size-compatible with the image’s format. In this case, the resulting image view’s texel dimensions equal the dimensions of the selected mip level divided by the compressed texel block size and rounded up.

The VkComponentMapping components member describes a remapping from components of the image to components of the vector returned by shader image instructions. This remapping must be the identity swizzle for storage image descriptors, input attachment descriptors, framebuffer attachments, and any VkImageView used with a combined image sampler that enables sampler Y′CBCR conversion.

If the image view is to be used with a sampler which supports sampler Y′CBCR conversion, an identically defined object of type VkSamplerYcbcrConversion to that used to create the sampler must be passed to CreateImageView in a VkSamplerYcbcrConversionInfo included in the pNext chain of VkImageViewCreateInfo. Conversely, if a VkSamplerYcbcrConversion object is passed to CreateImageView, an identically defined VkSamplerYcbcrConversion object must be used when sampling the image.

If the image has a multi-planar format, subresourceRange.aspectMask is IMAGE_ASPECT_COLOR_BIT, and usage includes IMAGE_USAGE_SAMPLED_BIT, then the format must be identical to the image format and the sampler to be used with the image view must enable sampler Y′CBCR conversion.

When such an image is used in a video coding operation, the sampler Y′CBCR conversion has no effect.

If image was created with the IMAGE_CREATE_MUTABLE_FORMAT_BIT and the image has a multi-planar format, and if subresourceRange.aspectMask is IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, or IMAGE_ASPECT_PLANE_2_BIT, format must be compatible with the corresponding plane of the image, and the sampler to be used with the image view must not enable sampler Y′CBCR conversion. The width and height of the single-plane image view must be derived from the multi-planar image’s dimensions in the manner listed for plane compatibility for the plane.

Any view of an image plane will have the same mapping between texel coordinates and memory locations as used by the components of the color aspect, subject to the formulae relating texel coordinates to lower-resolution planes as described in Chroma Reconstruction. That is, if an R or B plane has a reduced resolution relative to the G plane of the multi-planar image, the image view operates using the (uplane, vplane) unnormalized coordinates of the reduced-resolution plane, and these coordinates access the same memory locations as the (ucolor, vcolor) unnormalized coordinates of the color aspect for which chroma reconstruction operations operate on the same (uplane, vplane) or (iplane, jplane) coordinates.

Image type and image view type compatibility requirements
Image View TypeCompatible Image Types
IMAGE_VIEW_TYPE_1DIMAGE_TYPE_1D
IMAGE_VIEW_TYPE_1D_ARRAYIMAGE_TYPE_1D
IMAGE_VIEW_TYPE_2DIMAGE_TYPE_2D , IMAGE_TYPE_3D
IMAGE_VIEW_TYPE_2D_ARRAYIMAGE_TYPE_2D , IMAGE_TYPE_3D
IMAGE_VIEW_TYPE_CUBEIMAGE_TYPE_2D
IMAGE_VIEW_TYPE_CUBE_ARRAYIMAGE_TYPE_2D
IMAGE_VIEW_TYPE_3DIMAGE_TYPE_3D
Valid Usage
Valid Usage (Implicit)
See Also

VkComponentMapping, VkImageSubresourceRange, CreateImageView

Layout


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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
COMPONENTS

The struct member offsets.

public static final int
FLAGS

The struct member offsets.

public static final int
FORMAT

The struct member offsets.

public static final int
IMAGE

The struct member offsets.

public static final int
PNEXT

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
STYPE

The struct member offsets.

public static final int
SUBRESOURCERANGE

The struct member offsets.

public static final int
VIEWTYPE

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
VkImageViewCreateInfo(long address, ByteBuffer container)

public
VkImageViewCreateInfo(ByteBuffer container)

Creates a VkImageViewCreateInfo instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public static VkImageViewCreateInfo
calloc()

Returns a new VkImageViewCreateInfo instance allocated with memCalloc.

public static VkImageViewCreateInfo.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new VkImageViewCreateInfo.Buffer instance allocated with memCalloc.

public static VkImageViewCreateInfo
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkImageViewCreateInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkImageViewCreateInfo.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkImageViewCreateInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static VkImageViewCreateInfo
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VkImageViewCreateInfo
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkImageViewCreateInfo.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VkImageViewCreateInfo.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public VkComponentMapping
components()

a VkComponentMapping structure specifying a remapping of color components (or of depth or stencil components after they have been converted into color components).

public VkImageViewCreateInfo
components(VkComponentMapping value)

Copies the specified VkComponentMapping to the components field.

public VkImageViewCreateInfo
components(Consumer<VkComponentMapping> consumer)

Passes the components field to the specified Consumer.

protected VkImageViewCreateInfo
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static VkImageViewCreateInfo
create()

Returns a new VkImageViewCreateInfo instance allocated with BufferUtils.

public static VkImageViewCreateInfo
create(long address)

Returns a new VkImageViewCreateInfo instance for the specified memory address.

public static VkImageViewCreateInfo.Buffer
create(int
the buffer capacity
capacity
)

Returns a new VkImageViewCreateInfo.Buffer instance allocated with BufferUtils.

public static VkImageViewCreateInfo.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a VkImageViewCreateInfo.Buffer instance at the specified memory.

public static VkImageViewCreateInfo
createSafe(long address)

Like create, but returns null if address is NULL.

public static VkImageViewCreateInfo.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public int
flags()

a bitmask of VkImageViewCreateFlagBits specifying additional parameters of the image view.

public VkImageViewCreateInfo
flags(int value)

Sets the specified value to the flags field.

public int
format()

a VkFormat specifying the format and type used to interpret texel blocks of the image.

public VkImageViewCreateInfo
format(int value)

Sets the specified value to the format field.

public long
image()

a VkImage on which the view will be created.

public VkImageViewCreateInfo
image(long value)

Sets the specified value to the image field.

public static VkImageViewCreateInfo
malloc()

Returns a new VkImageViewCreateInfo instance allocated with memAlloc.

public static VkImageViewCreateInfo.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new VkImageViewCreateInfo.Buffer instance allocated with memAlloc.

public static VkImageViewCreateInfo
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new VkImageViewCreateInfo instance allocated on the specified MemoryStack.

public static VkImageViewCreateInfo.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new VkImageViewCreateInfo.Buffer instance allocated on the specified MemoryStack.

public static VkImageViewCreateInfo
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static VkImageViewCreateInfo
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkImageViewCreateInfo.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static VkImageViewCreateInfo.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static VkComponentMapping
ncomponents(long struct)

Unsafe version of components.

public static void
ncomponents(long struct, VkComponentMapping value)

Unsafe version of components.

public static int
nflags(long struct)

Unsafe version of flags.

public static void
nflags(long struct, int value)

Unsafe version of flags.

public static int
nformat(long struct)

Unsafe version of format.

public static void
nformat(long struct, int value)

Unsafe version of format.

public static long
nimage(long struct)

Unsafe version of image.

public static void
nimage(long struct, long value)

Unsafe version of image.

public static long
npNext(long struct)

Unsafe version of pNext.

public static void
npNext(long struct, long value)

Unsafe version of pNext.

public static int
nsType(long struct)

Unsafe version of sType.

public static void
nsType(long struct, int value)

Unsafe version of sType.

public static VkImageSubresourceRange
nsubresourceRange(long struct)

Unsafe version of subresourceRange.

public static void
nsubresourceRange(long struct, VkImageSubresourceRange value)

Unsafe version of subresourceRange.

public static int
nviewType(long struct)

Unsafe version of viewType.

public static void
nviewType(long struct, int value)

Unsafe version of viewType.

public long
pNext()

NULL or a pointer to a structure extending this structure.

public VkImageViewCreateInfo
pNext(long value)

Sets the specified value to the pNext field.

public VkImageViewCreateInfo
pNext(VkExportMetalObjectCreateInfoEXT value)

Prepends the specified VkExportMetalObjectCreateInfoEXT value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkImageViewASTCDecodeModeEXT value)

Prepends the specified VkImageViewASTCDecodeModeEXT value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkImageViewMinLodCreateInfoEXT value)

Prepends the specified VkImageViewMinLodCreateInfoEXT value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkImageViewSampleWeightCreateInfoQCOM value)

Prepends the specified VkImageViewSampleWeightCreateInfoQCOM value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkImageViewSlicedCreateInfoEXT value)

Prepends the specified VkImageViewSlicedCreateInfoEXT value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkImageViewUsageCreateInfo value)

Prepends the specified VkImageViewUsageCreateInfo value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkImageViewUsageCreateInfoKHR value)

Prepends the specified VkImageViewUsageCreateInfoKHR value to the pNext chain.

public VkImageViewCreateInfo
public VkImageViewCreateInfo
pNext(VkSamplerYcbcrConversionInfo value)

Prepends the specified VkSamplerYcbcrConversionInfo value to the pNext chain.

public VkImageViewCreateInfo
pNext(VkSamplerYcbcrConversionInfoKHR value)

Prepends the specified VkSamplerYcbcrConversionInfoKHR value to the pNext chain.

public VkImageViewCreateInfo
set(int sType, long pNext, int flags, long image, int viewType, int format, VkComponentMapping components, VkImageSubresourceRange subresourceRange)

Initializes this struct with the specified values.

public VkImageViewCreateInfo

Returns:

this struct
set
(VkImageViewCreateInfo
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public int
sType()

a VkStructureType value identifying this structure.

public VkImageViewCreateInfo
sType(int value)

Sets the specified value to the sType field.

public VkImageViewCreateInfo
public VkImageSubresourceRange
subresourceRange()

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

public VkImageViewCreateInfo
public VkImageViewCreateInfo
subresourceRange(Consumer<VkImageSubresourceRange> consumer)

Passes the subresourceRange field to the specified Consumer.

public int
viewType()

a VkImageViewType value specifying the type of the image view.

public VkImageViewCreateInfo
viewType(int value)

Sets the specified value to the viewType field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate