Class VkSparseMemoryBind
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkSparseMemoryBind
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkSparseMemoryBind extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying a sparse memory bind operation.Description
The binding range
[resourceOffset, resourceOffset + size)
has different constraints based onflags
. Ifflags
containsSPARSE_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 × n
and
imageMipTailOffset
,imageMipTailSize
, andimageMipTailStride
values are from theVkSparseImageMemoryRequirements
corresponding to the metadata aspect of the image, andn
is a valid array layer index for the image,imageMipTailStride
is considered to be zero for aspects whereVkSparseImageMemoryRequirements
::formatProperties
.flags containsSPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT
.If
flags
does not containSPARSE_MEMORY_BIND_METADATA_BIT
, the binding range must be within the range[0,
.VkMemoryRequirements
::size)Valid Usage
- If
memory
is notNULL_HANDLE
,memory
andmemoryOffset
must match the memory requirements of the resource, as described in section Resource Memory Association - If
memory
is notNULL_HANDLE
,memory
must not have been created with a memory type that reportsMEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
bit set size
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 minusresourceOffset
memoryOffset
must be less than the size ofmemory
size
must be less than or equal to the size ofmemory
minusmemoryOffset
- If
memory
was created withVkExportMemoryAllocateInfo
::handleTypes
not equal to 0, at least one handle type it contained must also have been set inVkExternalMemoryBufferCreateInfo
::handleTypes
orVkExternalMemoryImageCreateInfo
::handleTypes
when the resource was created. - If
memory
was created by a memory import operation, the external handle type of the imported memory must also have been set inVkExternalMemoryBufferCreateInfo
::handleTypes
orVkExternalMemoryImageCreateInfo
::handleTypes
when the resource was created.
Valid Usage (Implicit)
- If
memory
is notNULL_HANDLE
,memory
must be a validVkDeviceMemory
handle flags
must be a valid combination ofVkSparseMemoryBindFlagBits
values
See Also
VkSparseBufferMemoryBindInfo
,VkSparseImageOpaqueMemoryBindInfo
Member documentation
resourceOffset
– the offset into the resource.size
– the size of the memory region to be bound.memory
– theVkDeviceMemory
object that the range of the resource is bound to. Ifmemory
isNULL_HANDLE
, the range is unbound.memoryOffset
– the offset into theVkDeviceMemory
object to bind the resource range to. Ifmemory
isNULL_HANDLE
, this value is ignored.flags
– a bitmask ofVkSparseMemoryBindFlagBits
specifying usage of the binding operation.
Layout
struct VkSparseMemoryBind { VkDeviceSize resourceOffset; VkDeviceSize size; VkDeviceMemory memory; VkDeviceSize memoryOffset; VkSparseMemoryBindFlags flags; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkSparseMemoryBind.Buffer
An array ofVkSparseMemoryBind
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
FLAGS
MEMORY
MEMORYOFFSET
RESOURCEOFFSET
SIZEThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkSparseMemoryBind(java.nio.ByteBuffer container)
Creates aVkSparseMemoryBind
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkSparseMemoryBind
calloc()
Returns a newVkSparseMemoryBind
instance allocated withmemCalloc
.static VkSparseMemoryBind.Buffer
calloc(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated withmemCalloc
.static VkSparseMemoryBind
callocStack()
Returns a newVkSparseMemoryBind
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSparseMemoryBind.Buffer
callocStack(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSparseMemoryBind.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkSparseMemoryBind
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkSparseMemoryBind
create()
Returns a newVkSparseMemoryBind
instance allocated withBufferUtils
.static VkSparseMemoryBind.Buffer
create(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated withBufferUtils
.static VkSparseMemoryBind
create(long address)
Returns a newVkSparseMemoryBind
instance for the specified memory address.static VkSparseMemoryBind.Buffer
create(long address, int capacity)
Create aVkSparseMemoryBind.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 theflags
field.VkSparseMemoryBind
flags(int value)
Sets the specified value to theflags
field.static VkSparseMemoryBind
malloc()
Returns a newVkSparseMemoryBind
instance allocated withmemAlloc
.static VkSparseMemoryBind.Buffer
malloc(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated withmemAlloc
.static VkSparseMemoryBind
mallocStack()
Returns a newVkSparseMemoryBind
instance allocated on the thread-localMemoryStack
.static VkSparseMemoryBind.Buffer
mallocStack(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
.static VkSparseMemoryBind.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the specifiedMemoryStack
.static VkSparseMemoryBind
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind
instance allocated on the specifiedMemoryStack
.long
memory()
Returns the value of thememory
field.VkSparseMemoryBind
memory(long value)
Sets the specified value to thememory
field.long
memoryOffset()
Returns the value of thememoryOffset
field.VkSparseMemoryBind
memoryOffset(long value)
Sets the specified value to thememoryOffset
field.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static long
nmemory(long struct)
Unsafe version ofmemory()
.static void
nmemory(long struct, long value)
Unsafe version ofmemory
.static long
nmemoryOffset(long struct)
Unsafe version ofmemoryOffset()
.static void
nmemoryOffset(long struct, long value)
Unsafe version ofmemoryOffset
.static long
nresourceOffset(long struct)
Unsafe version ofresourceOffset()
.static void
nresourceOffset(long struct, long value)
Unsafe version ofresourceOffset
.static long
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, long value)
Unsafe version ofsize
.long
resourceOffset()
Returns the value of theresourceOffset
field.VkSparseMemoryBind
resourceOffset(long value)
Sets the specified value to theresourceOffset
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 thesize
field.VkSparseMemoryBind
size(long value)
Sets the specified value to thesize
field.int
sizeof()
-
-
-
Constructor Detail
-
VkSparseMemoryBind
public VkSparseMemoryBind(java.nio.ByteBuffer container)
Creates aVkSparseMemoryBind
instance at the current position of the specifiedByteBuffer
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
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
resourceOffset
public long resourceOffset()
Returns the value of theresourceOffset
field.
-
size
public long size()
Returns the value of thesize
field.
-
memory
public long memory()
Returns the value of thememory
field.
-
memoryOffset
public long memoryOffset()
Returns the value of thememoryOffset
field.
-
flags
public int flags()
Returns the value of theflags
field.
-
resourceOffset
public VkSparseMemoryBind resourceOffset(long value)
Sets the specified value to theresourceOffset
field.
-
size
public VkSparseMemoryBind size(long value)
Sets the specified value to thesize
field.
-
memory
public VkSparseMemoryBind memory(long value)
Sets the specified value to thememory
field.
-
memoryOffset
public VkSparseMemoryBind memoryOffset(long value)
Sets the specified value to thememoryOffset
field.
-
flags
public VkSparseMemoryBind flags(int value)
Sets the specified value to theflags
field.
-
set
public VkSparseMemoryBind set(long resourceOffset, long size, long memory, long memoryOffset, int flags)
Initializes this struct with the specified values.
-
set
public VkSparseMemoryBind set(VkSparseMemoryBind src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkSparseMemoryBind malloc()
Returns a newVkSparseMemoryBind
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkSparseMemoryBind calloc()
Returns a newVkSparseMemoryBind
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkSparseMemoryBind create()
Returns a newVkSparseMemoryBind
instance allocated withBufferUtils
.
-
create
public static VkSparseMemoryBind create(long address)
Returns a newVkSparseMemoryBind
instance for the specified memory address.
-
createSafe
@Nullable public static VkSparseMemoryBind createSafe(long address)
-
malloc
public static VkSparseMemoryBind.Buffer malloc(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkSparseMemoryBind.Buffer calloc(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSparseMemoryBind.Buffer create(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSparseMemoryBind.Buffer create(long address, int capacity)
Create aVkSparseMemoryBind.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkSparseMemoryBind.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkSparseMemoryBind mallocStack()
Returns a newVkSparseMemoryBind
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkSparseMemoryBind callocStack()
Returns a newVkSparseMemoryBind
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkSparseMemoryBind mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkSparseMemoryBind callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkSparseMemoryBind.Buffer mallocStack(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkSparseMemoryBind.Buffer callocStack(int capacity)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkSparseMemoryBind.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkSparseMemoryBind.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBind.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nresourceOffset
public static long nresourceOffset(long struct)
Unsafe version ofresourceOffset()
.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize()
.
-
nmemory
public static long nmemory(long struct)
Unsafe version ofmemory()
.
-
nmemoryOffset
public static long nmemoryOffset(long struct)
Unsafe version ofmemoryOffset()
.
-
nflags
public static int nflags(long struct)
Unsafe version offlags()
.
-
nresourceOffset
public static void nresourceOffset(long struct, long value)
Unsafe version ofresourceOffset
.
-
nsize
public static void nsize(long struct, long value)
Unsafe version ofsize
.
-
nmemory
public static void nmemory(long struct, long value)
Unsafe version ofmemory
.
-
nmemoryOffset
public static void nmemoryOffset(long struct, long value)
Unsafe version ofmemoryOffset
.
-
nflags
public static void nflags(long struct, int value)
Unsafe version offlags
.
-
-