public class VkSparseMemoryBind
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
The binding range [resourceOffset, resourceOffset + size) has different constraints based on flags. If flags contains SPARSE_MEMORY_BIND_METADATA_BIT, the binding range must be within the mip tail region of the metadata aspect. This metadata region is defined by:
metadataRegion = [base, base imageMipTailSize)base = imageMipTailOffset imageMipTailStride × nand imageMipTailOffset, imageMipTailSize, and imageMipTailStride values are from the VkSparseImageMemoryRequirements corresponding to the metadata aspect of the image, and n is a valid array layer index for the image,
imageMipTailStride is considered to be zero for aspects where VkSparseImageMemoryRequirements::formatProperties.flags contains SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT.
If flags does not contain SPARSE_MEMORY_BIND_METADATA_BIT, the binding range must be within the range [0,.VkMemoryRequirements::size)
memory is not NULL_HANDLE, memory and memoryOffset must match the memory requirements of the resource, as described in section Resource Memory Associationmemory is not NULL_HANDLE, memory must not have been created with a memory type that reports MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit setsize must be greater than 0resourceOffset must be less than the size of the resourcesize must be less than or equal to the size of the resource minus resourceOffsetmemoryOffset must be less than the size of memorysize must be less than or equal to the size of memory minus memoryOffsetmemory was created with VkExportMemoryAllocateInfo::handleTypes not equal to 0, at least one handle type it contained must also have been set in VkExternalMemoryBufferCreateInfo::handleTypes or VkExternalMemoryImageCreateInfo::handleTypes when the resource was created.memory was created by a memory import operation, the external handle type of the imported memory must also have been set in VkExternalMemoryBufferCreateInfo::handleTypes or VkExternalMemoryImageCreateInfo::handleTypes when the resource was created.memory is not NULL_HANDLE, memory must be a valid VkDeviceMemory handleflags must be a valid combination of VkSparseMemoryBindFlagBits valuesVkSparseBufferMemoryBindInfo, VkSparseImageOpaqueMemoryBindInfo
resourceOffset – the offset into the resource.size – the size of the memory region to be bound.memory – the VkDeviceMemory object that the range of the resource is bound to. If memory is NULL_HANDLE, the range is unbound.memoryOffset – the offset into the VkDeviceMemory object to bind the resource range to. If memory is NULL_HANDLE, this value is ignored.flags – a bitmask of VkSparseMemoryBindFlagBits specifying usage of the binding operation.
struct VkSparseMemoryBind {
VkDeviceSize resourceOffset;
VkDeviceSize size;
VkDeviceMemory memory;
VkDeviceSize memoryOffset;
VkSparseMemoryBindFlags flags;
}| Modifier and Type | Class and Description |
|---|---|
static class |
VkSparseMemoryBind.Buffer
An array of
VkSparseMemoryBind structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
FLAGS
The struct member offsets.
|
static int |
MEMORY
The struct member offsets.
|
static int |
MEMORYOFFSET
The struct member offsets.
|
static int |
RESOURCEOFFSET
The struct member offsets.
|
static int |
SIZE
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
| Constructor and Description |
|---|
VkSparseMemoryBind(java.nio.ByteBuffer container)
Creates a
VkSparseMemoryBind instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static VkSparseMemoryBind |
calloc()
Returns a new
VkSparseMemoryBind instance allocated with memCalloc. |
static VkSparseMemoryBind.Buffer |
calloc(int capacity)
Returns a new
VkSparseMemoryBind.Buffer instance allocated with memCalloc. |
static VkSparseMemoryBind |
callocStack()
Returns a new
VkSparseMemoryBind instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkSparseMemoryBind.Buffer |
callocStack(int capacity)
Returns a new
VkSparseMemoryBind.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkSparseMemoryBind.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkSparseMemoryBind.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkSparseMemoryBind |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkSparseMemoryBind instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkSparseMemoryBind |
create()
Returns a new
VkSparseMemoryBind instance allocated with BufferUtils. |
static VkSparseMemoryBind.Buffer |
create(int capacity)
Returns a new
VkSparseMemoryBind.Buffer instance allocated with BufferUtils. |
static VkSparseMemoryBind |
create(long address)
Returns a new
VkSparseMemoryBind instance for the specified memory address. |
static VkSparseMemoryBind.Buffer |
create(long address,
int capacity)
Create a
VkSparseMemoryBind.Buffer instance at the specified memory. |
static VkSparseMemoryBind |
createSafe(long address)
|
static VkSparseMemoryBind.Buffer |
createSafe(long address,
int capacity)
|
int |
flags()
Returns the value of the
flags field. |
VkSparseMemoryBind |
flags(int value)
Sets the specified value to the
flags field. |
static VkSparseMemoryBind |
malloc()
Returns a new
VkSparseMemoryBind instance allocated with memAlloc. |
static VkSparseMemoryBind.Buffer |
malloc(int capacity)
Returns a new
VkSparseMemoryBind.Buffer instance allocated with memAlloc. |
static VkSparseMemoryBind |
mallocStack()
Returns a new
VkSparseMemoryBind instance allocated on the thread-local MemoryStack. |
static VkSparseMemoryBind.Buffer |
mallocStack(int capacity)
Returns a new
VkSparseMemoryBind.Buffer instance allocated on the thread-local MemoryStack. |
static VkSparseMemoryBind.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkSparseMemoryBind.Buffer instance allocated on the specified MemoryStack. |
static VkSparseMemoryBind |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkSparseMemoryBind instance allocated on the specified MemoryStack. |
long |
memory()
Returns the value of the
memory field. |
VkSparseMemoryBind |
memory(long value)
Sets the specified value to the
memory field. |
long |
memoryOffset()
Returns the value of the
memoryOffset field. |
VkSparseMemoryBind |
memoryOffset(long value)
Sets the specified value to the
memoryOffset field. |
static int |
nflags(long struct)
Unsafe version of
flags(). |
static void |
nflags(long struct,
int value)
Unsafe version of
flags. |
static long |
nmemory(long struct)
Unsafe version of
memory(). |
static void |
nmemory(long struct,
long value)
Unsafe version of
memory. |
static long |
nmemoryOffset(long struct)
Unsafe version of
memoryOffset(). |
static void |
nmemoryOffset(long struct,
long value)
Unsafe version of
memoryOffset. |
static long |
nresourceOffset(long struct)
Unsafe version of
resourceOffset(). |
static void |
nresourceOffset(long struct,
long value)
Unsafe version of
resourceOffset. |
static long |
nsize(long struct)
Unsafe version of
size(). |
static void |
nsize(long struct,
long value)
Unsafe version of
size. |
long |
resourceOffset()
Returns the value of the
resourceOffset field. |
VkSparseMemoryBind |
resourceOffset(long value)
Sets the specified value to the
resourceOffset field. |
VkSparseMemoryBind |
set(long resourceOffset,
long size,
long memory,
long memoryOffset,
int flags)
Initializes this struct with the specified values.
|
VkSparseMemoryBind |
set(VkSparseMemoryBind src)
Copies the specified struct data to this struct.
|
long |
size()
Returns the value of the
size field. |
VkSparseMemoryBind |
size(long value)
Sets the specified value to the
size field. |
int |
sizeof() |
public static final int SIZEOF
public static final int ALIGNOF
public static final int RESOURCEOFFSET
public static final int SIZE
public static final int MEMORY
public static final int MEMORYOFFSET
public static final int FLAGS
public VkSparseMemoryBind(java.nio.ByteBuffer container)
VkSparseMemoryBind 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic long resourceOffset()
resourceOffset field.public long size()
size field.public long memory()
memory field.public long memoryOffset()
memoryOffset field.public int flags()
flags field.public VkSparseMemoryBind resourceOffset(long value)
resourceOffset field.public VkSparseMemoryBind size(long value)
size field.public VkSparseMemoryBind memory(long value)
memory field.public VkSparseMemoryBind memoryOffset(long value)
memoryOffset field.public VkSparseMemoryBind flags(int value)
flags field.public VkSparseMemoryBind set(long resourceOffset, long size, long memory, long memoryOffset, int flags)
public VkSparseMemoryBind set(VkSparseMemoryBind src)
src - the source structpublic static VkSparseMemoryBind malloc()
VkSparseMemoryBind instance allocated with memAlloc. The instance must be explicitly freed.public static VkSparseMemoryBind calloc()
VkSparseMemoryBind instance allocated with memCalloc. The instance must be explicitly freed.public static VkSparseMemoryBind create()
VkSparseMemoryBind instance allocated with BufferUtils.public static VkSparseMemoryBind create(long address)
VkSparseMemoryBind instance for the specified memory address.@Nullable public static VkSparseMemoryBind createSafe(long address)
public static VkSparseMemoryBind.Buffer malloc(int capacity)
VkSparseMemoryBind.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkSparseMemoryBind.Buffer calloc(int capacity)
VkSparseMemoryBind.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkSparseMemoryBind.Buffer create(int capacity)
VkSparseMemoryBind.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static VkSparseMemoryBind.Buffer create(long address, int capacity)
VkSparseMemoryBind.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static VkSparseMemoryBind.Buffer createSafe(long address, int capacity)
public static VkSparseMemoryBind mallocStack()
VkSparseMemoryBind instance allocated on the thread-local MemoryStack.public static VkSparseMemoryBind callocStack()
VkSparseMemoryBind instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static VkSparseMemoryBind mallocStack(org.lwjgl.system.MemoryStack stack)
VkSparseMemoryBind instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static VkSparseMemoryBind callocStack(org.lwjgl.system.MemoryStack stack)
VkSparseMemoryBind instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static VkSparseMemoryBind.Buffer mallocStack(int capacity)
VkSparseMemoryBind.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static VkSparseMemoryBind.Buffer callocStack(int capacity)
VkSparseMemoryBind.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static VkSparseMemoryBind.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkSparseMemoryBind.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static VkSparseMemoryBind.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkSparseMemoryBind.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static long nresourceOffset(long struct)
resourceOffset().public static long nsize(long struct)
size().public static long nmemory(long struct)
memory().public static long nmemoryOffset(long struct)
memoryOffset().public static int nflags(long struct)
flags().public static void nresourceOffset(long struct,
long value)
resourceOffset.public static void nsize(long struct,
long value)
size.public static void nmemory(long struct,
long value)
memory.public static void nmemoryOffset(long struct,
long value)
memoryOffset.public static void nflags(long struct,
int value)
flags.Copyright LWJGL. All Rights Reserved. License terms.