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.NativeResourceStructure specifying a sparse memory bind operation.Description
The binding range
[resourceOffset, resourceOffset + size)has different constraints based onflags. IfflagscontainsSPARSE_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, andimageMipTailStridevalues are from theVkSparseImageMemoryRequirementscorresponding to the metadata aspect of the image, andnis a valid array layer index for the image,imageMipTailStrideis considered to be zero for aspects whereVkSparseImageMemoryRequirements::formatProperties.flags containsSPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT.If
flagsdoes not containSPARSE_MEMORY_BIND_METADATA_BIT, the binding range must be within the range[0,.VkMemoryRequirements::size)Valid Usage
- If
memoryis notNULL_HANDLE,memoryandmemoryOffsetmust match the memory requirements of the resource, as described in section Resource Memory Association - If
memoryis notNULL_HANDLE,memorymust not have been created with a memory type that reportsMEMORY_PROPERTY_LAZILY_ALLOCATED_BITbit set sizemust be greater than 0resourceOffsetmust be less than the size of the resourcesizemust be less than or equal to the size of the resource minusresourceOffsetmemoryOffsetmust be less than the size ofmemorysizemust be less than or equal to the size ofmemoryminusmemoryOffset- If
memorywas created withVkExportMemoryAllocateInfo::handleTypesnot equal to 0, at least one handle type it contained must also have been set inVkExternalMemoryBufferCreateInfo::handleTypesorVkExternalMemoryImageCreateInfo::handleTypeswhen the resource was created. - If
memorywas created by a memory import operation, the external handle type of the imported memory must also have been set inVkExternalMemoryBufferCreateInfo::handleTypesorVkExternalMemoryImageCreateInfo::handleTypeswhen the resource was created.
Valid Usage (Implicit)
- If
memoryis notNULL_HANDLE,memorymust be a validVkDeviceMemoryhandle flagsmust be a valid combination ofVkSparseMemoryBindFlagBitsvalues
See Also
VkSparseBufferMemoryBindInfo,VkSparseImageOpaqueMemoryBindInfoMember documentation
resourceOffset– the offset into the resource.size– the size of the memory region to be bound.memory– theVkDeviceMemoryobject that the range of the resource is bound to. IfmemoryisNULL_HANDLE, the range is unbound.memoryOffset– the offset into theVkDeviceMemoryobject to bind the resource range to. IfmemoryisNULL_HANDLE, this value is ignored.flags– a bitmask ofVkSparseMemoryBindFlagBitsspecifying 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 classVkSparseMemoryBind.BufferAn array ofVkSparseMemoryBindstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intFLAGS
MEMORY
MEMORYOFFSET
RESOURCEOFFSET
SIZEThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkSparseMemoryBind(java.nio.ByteBuffer container)Creates aVkSparseMemoryBindinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkSparseMemoryBindcalloc()Returns a newVkSparseMemoryBindinstance allocated withmemCalloc.static VkSparseMemoryBind.Buffercalloc(int capacity)Returns a newVkSparseMemoryBind.Bufferinstance allocated withmemCalloc.static VkSparseMemoryBindcallocStack()Returns a newVkSparseMemoryBindinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkSparseMemoryBind.BuffercallocStack(int capacity)Returns a newVkSparseMemoryBind.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkSparseMemoryBind.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkSparseMemoryBind.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkSparseMemoryBindcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkSparseMemoryBindinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkSparseMemoryBindcreate()Returns a newVkSparseMemoryBindinstance allocated withBufferUtils.static VkSparseMemoryBind.Buffercreate(int capacity)Returns a newVkSparseMemoryBind.Bufferinstance allocated withBufferUtils.static VkSparseMemoryBindcreate(long address)Returns a newVkSparseMemoryBindinstance for the specified memory address.static VkSparseMemoryBind.Buffercreate(long address, int capacity)Create aVkSparseMemoryBind.Bufferinstance at the specified memory.static VkSparseMemoryBindcreateSafe(long address)static VkSparseMemoryBind.BuffercreateSafe(long address, int capacity)intflags()Returns the value of theflagsfield.VkSparseMemoryBindflags(int value)Sets the specified value to theflagsfield.static VkSparseMemoryBindmalloc()Returns a newVkSparseMemoryBindinstance allocated withmemAlloc.static VkSparseMemoryBind.Buffermalloc(int capacity)Returns a newVkSparseMemoryBind.Bufferinstance allocated withmemAlloc.static VkSparseMemoryBindmallocStack()Returns a newVkSparseMemoryBindinstance allocated on the thread-localMemoryStack.static VkSparseMemoryBind.BuffermallocStack(int capacity)Returns a newVkSparseMemoryBind.Bufferinstance allocated on the thread-localMemoryStack.static VkSparseMemoryBind.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkSparseMemoryBind.Bufferinstance allocated on the specifiedMemoryStack.static VkSparseMemoryBindmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkSparseMemoryBindinstance allocated on the specifiedMemoryStack.longmemory()Returns the value of thememoryfield.VkSparseMemoryBindmemory(long value)Sets the specified value to thememoryfield.longmemoryOffset()Returns the value of thememoryOffsetfield.VkSparseMemoryBindmemoryOffset(long value)Sets the specified value to thememoryOffsetfield.static intnflags(long struct)Unsafe version offlags().static voidnflags(long struct, int value)Unsafe version offlags.static longnmemory(long struct)Unsafe version ofmemory().static voidnmemory(long struct, long value)Unsafe version ofmemory.static longnmemoryOffset(long struct)Unsafe version ofmemoryOffset().static voidnmemoryOffset(long struct, long value)Unsafe version ofmemoryOffset.static longnresourceOffset(long struct)Unsafe version ofresourceOffset().static voidnresourceOffset(long struct, long value)Unsafe version ofresourceOffset.static longnsize(long struct)Unsafe version ofsize().static voidnsize(long struct, long value)Unsafe version ofsize.longresourceOffset()Returns the value of theresourceOffsetfield.VkSparseMemoryBindresourceOffset(long value)Sets the specified value to theresourceOffsetfield.VkSparseMemoryBindset(long resourceOffset, long size, long memory, long memoryOffset, int flags)Initializes this struct with the specified values.VkSparseMemoryBindset(VkSparseMemoryBind src)Copies the specified struct data to this struct.longsize()Returns the value of thesizefield.VkSparseMemoryBindsize(long value)Sets the specified value to thesizefield.intsizeof()
-
-
-
Constructor Detail
-
VkSparseMemoryBind
public VkSparseMemoryBind(java.nio.ByteBuffer container)
Creates aVkSparseMemoryBindinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
resourceOffset
public long resourceOffset()
Returns the value of theresourceOffsetfield.
-
size
public long size()
Returns the value of thesizefield.
-
memory
public long memory()
Returns the value of thememoryfield.
-
memoryOffset
public long memoryOffset()
Returns the value of thememoryOffsetfield.
-
flags
public int flags()
Returns the value of theflagsfield.
-
resourceOffset
public VkSparseMemoryBind resourceOffset(long value)
Sets the specified value to theresourceOffsetfield.
-
size
public VkSparseMemoryBind size(long value)
Sets the specified value to thesizefield.
-
memory
public VkSparseMemoryBind memory(long value)
Sets the specified value to thememoryfield.
-
memoryOffset
public VkSparseMemoryBind memoryOffset(long value)
Sets the specified value to thememoryOffsetfield.
-
flags
public VkSparseMemoryBind flags(int value)
Sets the specified value to theflagsfield.
-
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 newVkSparseMemoryBindinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkSparseMemoryBind calloc()
Returns a newVkSparseMemoryBindinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkSparseMemoryBind create()
Returns a newVkSparseMemoryBindinstance allocated withBufferUtils.
-
create
public static VkSparseMemoryBind create(long address)
Returns a newVkSparseMemoryBindinstance for the specified memory address.
-
createSafe
@Nullable public static VkSparseMemoryBind createSafe(long address)
-
malloc
public static VkSparseMemoryBind.Buffer malloc(int capacity)
Returns a newVkSparseMemoryBind.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkSparseMemoryBind.Buffer calloc(int capacity)
Returns a newVkSparseMemoryBind.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkSparseMemoryBind.Buffer create(int capacity)
Returns a newVkSparseMemoryBind.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkSparseMemoryBind.Buffer create(long address, int capacity)
Create aVkSparseMemoryBind.Bufferinstance 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 newVkSparseMemoryBindinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkSparseMemoryBind callocStack()
Returns a newVkSparseMemoryBindinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkSparseMemoryBind mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBindinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkSparseMemoryBind callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseMemoryBindinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkSparseMemoryBind.Buffer callocStack(int capacity)
Returns a newVkSparseMemoryBind.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-