If the image is linear, then rowPitch, arrayPitch and depthPitch describe the layout of the image subresource in linear memory. For uncompressed formats, rowPitch is the number of bytes between texels with the same x coordinate in adjacent rows (y coordinates differ by one). arrayPitch is the number of bytes between texels with the same x and y coordinate in adjacent array layers of the image (array layer values differ by one). depthPitch is the number of bytes between texels with the same x and y coordinate in adjacent slices of a 3D image (z coordinates differ by one). Expressed as an addressing formula, the starting byte of a texel in the image subresource has address:
// (x,y,z,layer) are in texel coordinates
address(x,y,z,layer) = layer*arrayPitch + z*depthPitch + y*rowPitch + x*elementSize + offset
For compressed formats, the rowPitch is the number of bytes between compressed texel blocks in adjacent rows. arrayPitch is the number of bytes between compressed texel blocks in adjacent array layers. depthPitch is the number of bytes between compressed texel blocks in adjacent slices of a 3D image.
// (x,y,z,layer) are in compressed texel block coordinates
address(x,y,z,layer) = layer*arrayPitch + z*depthPitch + y*rowPitch + x*compressedTexelBlockByteSize + offset;
The value of arrayPitch is undefined for images that were not created as arrays. depthPitch is defined only for 3D images.
If the image has a single-plane color format and its tiling is IMAGE_TILING_LINEAR , then the aspectMask member of VkImageSubresource must be IMAGE_ASPECT_COLOR_BIT.
If the image has a depth/stencil format and its tiling is IMAGE_TILING_LINEAR , then aspectMask must be either IMAGE_ASPECT_DEPTH_BIT or IMAGE_ASPECT_STENCIL_BIT. On implementations that store depth and stencil aspects separately, querying each of these image subresource layouts will return a different offset and size representing the region of memory used for that aspect. On implementations that store depth and stencil aspects interleaved, the same offset and size are returned and represent the interleaved memory allocation.
If the image has a multi-planar format and its tiling is IMAGE_TILING_LINEAR , then the aspectMask member of VkImageSubresource must be IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, or (for 3-plane formats only) IMAGE_ASPECT_PLANE_2_BIT. Querying each of these image subresource layouts will return a different offset and size representing the region of memory used for that plane. If the image is disjoint, then the offset is relative to the base address of the plane. If the image is non-disjoint, then the offset is relative to the base address of the image.
If the image’s tiling is IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, then the aspectMask member of VkImageSubresource must be one of VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT, where the maximum allowed plane index i is defined by the VkDrmFormatModifierPropertiesEXT::drmFormatModifierPlaneCount associated with the image’s VkImageCreateInfo::format and modifier. The memory range used by the subresource is described by offset and size. If the image is disjoint, then the offset is relative to the base address of the memory plane. If the image is non-disjoint, then the offset is relative to the base address of the image. If the image is non-linear, then rowPitch, arrayPitch, and depthPitch have an implementation-dependent meaning.
VkImageDrmFormatModifierExplicitCreateInfoEXT, VkSubresourceLayout2KHR, GetImageSubresourceLayout
struct VkSubresourceLayout {
VkDeviceSize offset;
VkDeviceSize size;
VkDeviceSize rowPitch;
VkDeviceSize arrayPitch;
VkDeviceSize depthPitch;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | VkSubresourceLayout.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | ARRAYPITCH
The struct member offsets. |
| public static final int | DEPTHPITCH
The struct member offsets. |
| public static final int | OFFSET
The struct member offsets. |
| public static final int | ROWPITCH
The struct member offsets. |
| public static final int | SIZE
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkSubresourceLayout(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public VkSubresourceLayout | |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkSubresourceLayout | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkSubresourceLayout. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout. | |
| public static VkSubresourceLayout. | |
| protected VkSubresourceLayout | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout. | create(int
the buffer capacity capacity)Returns a new |
| public static VkSubresourceLayout. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout. | |
| public long | |
| public VkSubresourceLayout | |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkSubresourceLayout | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkSubresourceLayout. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout | |
| public static VkSubresourceLayout. | |
| public static VkSubresourceLayout. | |
| public static long | |
| public static void | |
| public static long | |
| public static void | |
| public static long | |
| public static void | |
| public static long | |
| public static void | |
| public static long | |
| public static void | |
| public long | offset()
the byte offset from the start of the image or the plane where the image subresource begins. |
| public VkSubresourceLayout | |
| public long | |
| public VkSubresourceLayout | |
| public VkSubresourceLayout | set(long offset, long size, long rowPitch, long arrayPitch, long depthPitch)
Initializes this struct with the specified values. |
| public VkSubresourceLayout | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public long | |
| public VkSubresourceLayout | |
| public int |
| ALIGNOF | back to summary |
|---|---|
| public static final int ALIGNOF The struct alignment in bytes. | |
| ARRAYPITCH | back to summary |
|---|---|
| public static final int ARRAYPITCH The struct member offsets. | |
| DEPTHPITCH | back to summary |
|---|---|
| public static final int DEPTHPITCH The struct member offsets. | |
| OFFSET | back to summary |
|---|---|
| public static final int OFFSET The struct member offsets. | |
| ROWPITCH | back to summary |
|---|---|
| public static final int ROWPITCH The struct member offsets. | |
| SIZE | back to summary |
|---|---|
| public static final int SIZE The struct member offsets. | |
| SIZEOF | back to summary |
|---|---|
| public static final int SIZEOF The struct size in bytes. | |
| VkSubresourceLayout | back to summary |
|---|---|
| protected VkSubresourceLayout(long address, ByteBuffer container) | |
| VkSubresourceLayout | back to summary |
|---|---|
| public VkSubresourceLayout(ByteBuffer container) Creates a The created instance holds a strong reference to the container object. | |
| arrayPitch | back to summary |
|---|---|
| public long arrayPitch() describes the number of bytes between each array layer of an image.
| |
| arrayPitch | back to summary |
|---|---|
| public VkSubresourceLayout arrayPitch(long value) Sets the specified value to the | |
| calloc | back to summary |
|---|---|
| public static VkSubresourceLayout calloc() Returns a new | |
| calloc | back to summary |
|---|---|
| public static VkSubresourceLayout. Returns a new
| |
| calloc | back to summary |
|---|---|
| public static VkSubresourceLayout calloc(MemoryStack stack) Returns a new
| |
| calloc | back to summary |
|---|---|
| public static VkSubresourceLayout. Returns a new
| |
| callocStack | back to summary |
|---|---|
| public static VkSubresourceLayout callocStack()
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static VkSubresourceLayout callocStack(MemoryStack stack)
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static VkSubresourceLayout. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| callocStack | back to summary |
|---|---|
| public static VkSubresourceLayout. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| create | back to summary |
|---|---|
| protected VkSubresourceLayout create(long address, ByteBuffer container) Implements abstract org. Doc from org. Similar to Effectively, every
| |
| create | back to summary |
|---|---|
| public static VkSubresourceLayout create() Returns a new | |
| create | back to summary |
|---|---|
| public static VkSubresourceLayout create(long address) Returns a new | |
| create | back to summary |
|---|---|
| public static VkSubresourceLayout. Returns a new
| |
| create | back to summary |
|---|---|
| public static VkSubresourceLayout. Create a
| |
| createSafe | back to summary |
|---|---|
| public static VkSubresourceLayout createSafe(long address) Like
| |
| createSafe | back to summary |
|---|---|
| public static VkSubresourceLayout. Like
| |
| depthPitch | back to summary |
|---|---|
| public long depthPitch() describes the number of bytes between each slice of 3D image.
| |
| depthPitch | back to summary |
|---|---|
| public VkSubresourceLayout depthPitch(long value) Sets the specified value to the | |
| malloc | back to summary |
|---|---|
| public static VkSubresourceLayout malloc() Returns a new | |
| malloc | back to summary |
|---|---|
| public static VkSubresourceLayout. Returns a new
| |
| malloc | back to summary |
|---|---|
| public static VkSubresourceLayout malloc(MemoryStack stack) Returns a new
| |
| malloc | back to summary |
|---|---|
| public static VkSubresourceLayout. Returns a new
| |
| mallocStack | back to summary |
|---|---|
| public static VkSubresourceLayout mallocStack()
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static VkSubresourceLayout mallocStack(MemoryStack stack)
Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static VkSubresourceLayout. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| mallocStack | back to summary |
|---|---|
| public static VkSubresourceLayout. Deprecated
Deprecated for removal in 3.4.0. Use
| |
| narrayPitch | back to summary |
|---|---|
| public static long narrayPitch(long struct) Unsafe version of | |
| narrayPitch | back to summary |
|---|---|
| public static void narrayPitch(long struct, long value) Unsafe version of | |
| ndepthPitch | back to summary |
|---|---|
| public static long ndepthPitch(long struct) Unsafe version of | |
| ndepthPitch | back to summary |
|---|---|
| public static void ndepthPitch(long struct, long value) Unsafe version of | |
| noffset | back to summary |
|---|---|
| public static long noffset(long struct) Unsafe version of | |
| noffset | back to summary |
|---|---|
| public static void noffset(long struct, long value) Unsafe version of | |
| nrowPitch | back to summary |
|---|---|
| public static long nrowPitch(long struct) Unsafe version of | |
| nrowPitch | back to summary |
|---|---|
| public static void nrowPitch(long struct, long value) Unsafe version of | |
| nsize | back to summary |
|---|---|
| public static long nsize(long struct) Unsafe version of | |
| nsize | back to summary |
|---|---|
| public static void nsize(long struct, long value) Unsafe version of | |
| offset | back to summary |
|---|---|
| public long offset() the byte offset from the start of the image or the plane where the image subresource begins.
| |
| offset | back to summary |
|---|---|
| public VkSubresourceLayout offset(long value) Sets the specified value to the | |
| rowPitch | back to summary |
|---|---|
| public long rowPitch() describes the number of bytes between each row of texels in an image.
| |
| rowPitch | back to summary |
|---|---|
| public VkSubresourceLayout rowPitch(long value) Sets the specified value to the | |
| set | back to summary |
|---|---|
| public VkSubresourceLayout set(long offset, long size, long rowPitch, long arrayPitch, long depthPitch) Initializes this struct with the specified values. | |
| set | back to summary |
|---|---|
| public VkSubresourceLayout set(VkSubresourceLayout src) Copies the specified struct data to this struct.
| |
| size | back to summary |
|---|---|
| public long size() the size in bytes of the image subresource.
| |
| size | back to summary |
|---|---|
| public VkSubresourceLayout size(long value) Sets the specified value to the | |
| sizeof | back to summary |
|---|---|
| public int sizeof() Implements abstract org. Doc from org. Returns
| |
VkSubresourceLayout structs.
| Modifier and Type | Field and Description |
|---|---|
| private static final VkSubresourceLayout |
| Access | Constructor and Description |
|---|---|
| public | Buffer(ByteBuffer container)
Creates a new |
| public | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public VkSubresourceLayout. | |
| public long | |
| public VkSubresourceLayout. | |
| protected VkSubresourceLayout | |
| public long | |
| public VkSubresourceLayout. | |
| public long | |
| public VkSubresourceLayout. | |
| protected VkSubresourceLayout. | |
| public long | |
| public VkSubresourceLayout. |
| ELEMENT_FACTORY | back to summary |
|---|---|
| private static final VkSubresourceLayout ELEMENT_FACTORY | |
| Buffer | back to summary |
|---|---|
| public Buffer(ByteBuffer container) Creates a new Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
by The created buffer instance holds a strong reference to the container object. | |
| Buffer | back to summary |
|---|---|
| public Buffer(long address, int cap) | |
| Buffer | back to summary |
|---|---|
| pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap) | |
| arrayPitch | back to summary |
|---|---|
public long arrayPitch()
| |
| arrayPitch | back to summary |
|---|---|
| public VkSubresourceLayout. Sets the specified value to the | |
| depthPitch | back to summary |
|---|---|
public long depthPitch()
| |
| depthPitch | back to summary |
|---|---|
| public VkSubresourceLayout. Sets the specified value to the | |
| getElementFactory | back to summary |
|---|---|
| protected VkSubresourceLayout getElementFactory() Implements abstract org.
| |
| offset | back to summary |
|---|---|
public long offset()
| |
| offset | back to summary |
|---|---|
| public VkSubresourceLayout. Sets the specified value to the | |
| rowPitch | back to summary |
|---|---|
public long rowPitch()
| |
| rowPitch | back to summary |
|---|---|
| public VkSubresourceLayout. Sets the specified value to the | |
| self | back to summary |
|---|---|
| protected VkSubresourceLayout. Implements abstract org.
| |
| size | back to summary |
|---|---|
public long size()
| |
| size | back to summary |
|---|---|
| public VkSubresourceLayout. Sets the specified value to the | |