Top Description Inners Fields Constructors Methods
org.lwjgl.vulkan

public Class VkSubresourceLayout

extends Struct<VkSubresourceLayout>
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 subresource layout.
Description

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.

See Also

VkImageDrmFormatModifierExplicitCreateInfoEXT, VkSubresourceLayout2KHR, GetImageSubresourceLayout

Layout


struct VkSubresourceLayout {
    VkDeviceSize offset;
    VkDeviceSize size;
    VkDeviceSize rowPitch;
    VkDeviceSize arrayPitch;
    VkDeviceSize depthPitch;
}

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
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.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

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

public
VkSubresourceLayout(ByteBuffer container)

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

Method Summary

Modifier and TypeMethod and Description
public long
arrayPitch()

describes the number of bytes between each array layer of an image.

public VkSubresourceLayout
arrayPitch(long value)

Sets the specified value to the arrayPitch field.

public static VkSubresourceLayout
calloc()

Returns a new VkSubresourceLayout instance allocated with memCalloc.

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

Returns a new VkSubresourceLayout.Buffer instance allocated with memCalloc.

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

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

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

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

public static VkSubresourceLayout
callocStack()

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

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

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

Deprecated
Deprecated for removal in 3.4.0.
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.lwjgl.system.Struct.create.

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

Returns a new VkSubresourceLayout instance allocated with BufferUtils.

public static VkSubresourceLayout
create(long address)

Returns a new VkSubresourceLayout instance for the specified memory address.

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

Returns a new VkSubresourceLayout.Buffer instance allocated with BufferUtils.

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

Create a VkSubresourceLayout.Buffer instance at the specified memory.

public static VkSubresourceLayout
createSafe(long address)

Like create, but returns null if address is NULL.

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

Like create, but returns null if address is NULL.

public long
depthPitch()

describes the number of bytes between each slice of 3D image.

public VkSubresourceLayout
depthPitch(long value)

Sets the specified value to the depthPitch field.

public static VkSubresourceLayout
malloc()

Returns a new VkSubresourceLayout instance allocated with memAlloc.

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

Returns a new VkSubresourceLayout.Buffer instance allocated with memAlloc.

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

Returns a new VkSubresourceLayout instance allocated on the specified MemoryStack.

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

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

public static VkSubresourceLayout
mallocStack()

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

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

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

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

Unsafe version of arrayPitch.

public static void
narrayPitch(long struct, long value)

Unsafe version of arrayPitch.

public static long
ndepthPitch(long struct)

Unsafe version of depthPitch.

public static void
ndepthPitch(long struct, long value)

Unsafe version of depthPitch.

public static long
noffset(long struct)

Unsafe version of offset.

public static void
noffset(long struct, long value)

Unsafe version of offset.

public static long
nrowPitch(long struct)

Unsafe version of rowPitch.

public static void
nrowPitch(long struct, long value)

Unsafe version of rowPitch.

public static long
nsize(long struct)

Unsafe version of size.

public static void
nsize(long struct, long value)

Unsafe version of size.

public long
offset()

the byte offset from the start of the image or the plane where the image subresource begins.

public VkSubresourceLayout
offset(long value)

Sets the specified value to the offset field.

public long
rowPitch()

describes the number of bytes between each row of texels in an image.

public VkSubresourceLayout
rowPitch(long value)

Sets the specified value to the rowPitch field.

public VkSubresourceLayout
set(long offset, long size, long rowPitch, long arrayPitch, long depthPitch)

Initializes this struct with the specified values.

public VkSubresourceLayout

Returns:

this struct
set
(VkSubresourceLayout
the source struct
src
)

Copies the specified struct data to this struct.

public long
size()

the size in bytes of the image subresource.

public VkSubresourceLayout
size(long value)

Sets the specified value to the size field.

public int
sizeof()

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

Returns sizeof(struct).
Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

ARRAYPITCHback to summary
public static final int ARRAYPITCH

The struct member offsets.

DEPTHPITCHback to summary
public static final int DEPTHPITCH

The struct member offsets.

OFFSETback to summary
public static final int OFFSET

The struct member offsets.

ROWPITCHback to summary
public static final int ROWPITCH

The struct member offsets.

SIZEback to summary
public static final int SIZE

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

Constructor Detail

VkSubresourceLayoutback to summary
protected VkSubresourceLayout(long address, ByteBuffer container)
VkSubresourceLayoutback to summary
public VkSubresourceLayout(ByteBuffer container)

Creates a VkSubresourceLayout instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

The created instance holds a strong reference to the container object.

Method Detail

arrayPitchback to summary
public long arrayPitch()

describes the number of bytes between each array layer of an image.

Annotations
@NativeType:VkDeviceSize
arrayPitchback to summary
public VkSubresourceLayout arrayPitch(long value)

Sets the specified value to the arrayPitch field.

callocback to summary
public static VkSubresourceLayout calloc()

Returns a new VkSubresourceLayout instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static VkSubresourceLayout.Buffer calloc(int capacity)

Returns a new VkSubresourceLayout.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static VkSubresourceLayout calloc(MemoryStack stack)

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

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static VkSubresourceLayout.Buffer calloc(int capacity, MemoryStack stack)

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

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static VkSubresourceLayout callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VkSubresourceLayout callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VkSubresourceLayout.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static VkSubresourceLayout.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected VkSubresourceLayout create(long address, ByteBuffer container)

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

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static VkSubresourceLayout create()

Returns a new VkSubresourceLayout instance allocated with BufferUtils.

createback to summary
public static VkSubresourceLayout create(long address)

Returns a new VkSubresourceLayout instance for the specified memory address.

createback to summary
public static VkSubresourceLayout.Buffer create(int capacity)

Returns a new VkSubresourceLayout.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static VkSubresourceLayout.Buffer create(long address, int capacity)

Create a VkSubresourceLayout.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static VkSubresourceLayout createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static VkSubresourceLayout.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
depthPitchback to summary
public long depthPitch()

describes the number of bytes between each slice of 3D image.

Annotations
@NativeType:VkDeviceSize
depthPitchback to summary
public VkSubresourceLayout depthPitch(long value)

Sets the specified value to the depthPitch field.

mallocback to summary
public static VkSubresourceLayout malloc()

Returns a new VkSubresourceLayout instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static VkSubresourceLayout.Buffer malloc(int capacity)

Returns a new VkSubresourceLayout.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static VkSubresourceLayout malloc(MemoryStack stack)

Returns a new VkSubresourceLayout instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static VkSubresourceLayout.Buffer malloc(int capacity, MemoryStack stack)

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

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static VkSubresourceLayout mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VkSubresourceLayout mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VkSubresourceLayout.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static VkSubresourceLayout.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
narrayPitchback to summary
public static long narrayPitch(long struct)

Unsafe version of arrayPitch.

narrayPitchback to summary
public static void narrayPitch(long struct, long value)

Unsafe version of arrayPitch.

ndepthPitchback to summary
public static long ndepthPitch(long struct)

Unsafe version of depthPitch.

ndepthPitchback to summary
public static void ndepthPitch(long struct, long value)

Unsafe version of depthPitch.

noffsetback to summary
public static long noffset(long struct)

Unsafe version of offset.

noffsetback to summary
public static void noffset(long struct, long value)

Unsafe version of offset.

nrowPitchback to summary
public static long nrowPitch(long struct)

Unsafe version of rowPitch.

nrowPitchback to summary
public static void nrowPitch(long struct, long value)

Unsafe version of rowPitch.

nsizeback to summary
public static long nsize(long struct)

Unsafe version of size.

nsizeback to summary
public static void nsize(long struct, long value)

Unsafe version of size.

offsetback to summary
public long offset()

the byte offset from the start of the image or the plane where the image subresource begins.

Annotations
@NativeType:VkDeviceSize
offsetback to summary
public VkSubresourceLayout offset(long value)

Sets the specified value to the offset field.

rowPitchback to summary
public long rowPitch()

describes the number of bytes between each row of texels in an image.

Annotations
@NativeType:VkDeviceSize
rowPitchback to summary
public VkSubresourceLayout rowPitch(long value)

Sets the specified value to the rowPitch field.

setback to summary
public VkSubresourceLayout set(long offset, long size, long rowPitch, long arrayPitch, long depthPitch)

Initializes this struct with the specified values.

setback to summary
public VkSubresourceLayout set(VkSubresourceLayout src)

Copies the specified struct data to this struct.

Parameters
src:VkSubresourceLayout

the source struct

Returns:VkSubresourceLayout

this struct

sizeback to summary
public long size()

the size in bytes of the image subresource. size includes any extra memory that is required based on rowPitch.

Annotations
@NativeType:VkDeviceSize
sizeback to summary
public VkSubresourceLayout size(long value)

Sets the specified value to the size field.

sizeofback to summary
public int sizeof()

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

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
org.lwjgl.vulkan back to summary

public Class VkSubresourceLayout.Buffer

extends StructBuffer<VkSubresourceLayout, VkSubresourceLayout.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of VkSubresourceLayout structs.

Field Summary

Modifier and TypeField and Description
private static final VkSubresourceLayout

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new VkSubresourceLayout.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

the value of the VkSubresourceLayout#arrayPitch field.
arrayPitch
()

public VkSubresourceLayout.Buffer
arrayPitch(long value)

Sets the specified value to the VkSubresourceLayout#arrayPitch field.

public long

Returns:

the value of the VkSubresourceLayout#depthPitch field.
depthPitch
()

public VkSubresourceLayout.Buffer
depthPitch(long value)

Sets the specified value to the VkSubresourceLayout#depthPitch field.

protected VkSubresourceLayout
public long

Returns:

the value of the VkSubresourceLayout#offset field.
offset
()

public VkSubresourceLayout.Buffer
offset(long value)

Sets the specified value to the VkSubresourceLayout#offset field.

public long

Returns:

the value of the VkSubresourceLayout#rowPitch field.
rowPitch
()

public VkSubresourceLayout.Buffer
rowPitch(long value)

Sets the specified value to the VkSubresourceLayout#rowPitch field.

protected VkSubresourceLayout.Buffer
public long

Returns:

the value of the VkSubresourceLayout#size field.
size
()

public VkSubresourceLayout.Buffer
size(long value)

Sets the specified value to the VkSubresourceLayout#size field.

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final VkSubresourceLayout ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new VkSubresourceLayout.Buffer instance backed by the specified container.

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 VkSubresourceLayout#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

arrayPitchback to summary
public long arrayPitch()
Returns:long

the value of the VkSubresourceLayout#arrayPitch field.

Annotations
@NativeType:VkDeviceSize
arrayPitchback to summary
public VkSubresourceLayout.Buffer arrayPitch(long value)

Sets the specified value to the VkSubresourceLayout#arrayPitch field.

depthPitchback to summary
public long depthPitch()
Returns:long

the value of the VkSubresourceLayout#depthPitch field.

Annotations
@NativeType:VkDeviceSize
depthPitchback to summary
public VkSubresourceLayout.Buffer depthPitch(long value)

Sets the specified value to the VkSubresourceLayout#depthPitch field.

getElementFactoryback to summary
protected VkSubresourceLayout getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
offsetback to summary
public long offset()
Returns:long

the value of the VkSubresourceLayout#offset field.

Annotations
@NativeType:VkDeviceSize
offsetback to summary
public VkSubresourceLayout.Buffer offset(long value)

Sets the specified value to the VkSubresourceLayout#offset field.

rowPitchback to summary
public long rowPitch()
Returns:long

the value of the VkSubresourceLayout#rowPitch field.

Annotations
@NativeType:VkDeviceSize
rowPitchback to summary
public VkSubresourceLayout.Buffer rowPitch(long value)

Sets the specified value to the VkSubresourceLayout#rowPitch field.

selfback to summary
protected VkSubresourceLayout.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
sizeback to summary
public long size()
Returns:long

the value of the VkSubresourceLayout#size field.

Annotations
@NativeType:VkDeviceSize
sizeback to summary
public VkSubresourceLayout.Buffer size(long value)

Sets the specified value to the VkSubresourceLayout#size field.