Package org.lwjgl.vulkan
Class VkSparseImageMemoryBind
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkSparseImageMemoryBind
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VkSparseImageMemoryBind extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure specifying sparse image memory bind.Valid Usage
- If the sparse aliased residency feature is not enabled, and if any other resources are bound to ranges of
memory, the range ofmemorybeing bound must not overlap with those bound ranges memoryandmemoryOffsetmust match the memory requirements of the calling command’simage, as described in section Resource Memory Associationsubresourcemust be a valid image subresource forimage(see Image Views)offset.xmust be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of the imageextent.widthmust either be a multiple of the sparse image block width of the image, or else(extent.width offset.x)must equal the width of the image subresourceoffset.ymust be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of the imageextent.heightmust either be a multiple of the sparse image block height of the image, or else(extent.height offset.y)must equal the height of the image subresourceoffset.zmust be a multiple of the sparse image block depth (VkSparseImageFormatProperties::imageGranularity.depth) of the imageextent.depthmust either be a multiple of the sparse image block depth of the image, or else(extent.depth offset.z)must equal the depth of the image subresource- If
memorywas created withVkExportMemoryAllocateInfo::handleTypesnot equal to 0, at least one handle type it contained must also have been set inVkExternalMemoryImageCreateInfo::handleTypeswhen the image was created. - If
memorywas created by a memory import operation, the external handle type of the imported memory must also have been set inVkExternalMemoryImageCreateInfo::handleTypeswhenimagewas created.
Valid Usage (Implicit)
subresourcemust be a validVkImageSubresourcestructure- If
memoryis notNULL_HANDLE,memorymust be a validVkDeviceMemoryhandle flagsmust be a valid combination ofVkSparseMemoryBindFlagBitsvalues
See Also
VkExtent3D,VkImageSubresource,VkOffset3D,VkSparseImageMemoryBindInfoMember documentation
subresource– the image aspect and region of interest in the image.offset– are the coordinates of the first texel within the image subresource to bind.extent– the size in texels of the region within the image subresource to bind. The extent must be a multiple of the sparse image block dimensions, except when binding sparse image blocks along the edge of an image subresource it can instead be such that any coordinate ofoffset + extentequals the corresponding dimensions of the image subresource.memory– theVkDeviceMemoryobject that the sparse image blocks of the image are bound to. IfmemoryisNULL_HANDLE, the sparse image blocks are unbound.memoryOffset– an offset intoVkDeviceMemoryobject. IfmemoryisNULL_HANDLE, this value is ignored.flags– are sparse memory binding flags.
Layout
struct VkSparseImageMemoryBind {VkImageSubresourcesubresource;VkOffset3Doffset;VkExtent3Dextent; VkDeviceMemory memory; VkDeviceSize memoryOffset; VkSparseMemoryBindFlags flags; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkSparseImageMemoryBind.BufferAn array ofVkSparseImageMemoryBindstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intEXTENT
FLAGS
MEMORY
MEMORYOFFSET
OFFSETThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSUBRESOURCEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkSparseImageMemoryBind(java.nio.ByteBuffer container)Creates aVkSparseImageMemoryBindinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkSparseImageMemoryBindcalloc()Returns a newVkSparseImageMemoryBindinstance allocated withmemCalloc.static VkSparseImageMemoryBind.Buffercalloc(int capacity)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated withmemCalloc.static VkSparseImageMemoryBindcallocStack()Returns a newVkSparseImageMemoryBindinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkSparseImageMemoryBind.BuffercallocStack(int capacity)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkSparseImageMemoryBind.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkSparseImageMemoryBindcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkSparseImageMemoryBindinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkSparseImageMemoryBindcreate()Returns a newVkSparseImageMemoryBindinstance allocated withBufferUtils.static VkSparseImageMemoryBind.Buffercreate(int capacity)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated withBufferUtils.static VkSparseImageMemoryBindcreate(long address)Returns a newVkSparseImageMemoryBindinstance for the specified memory address.static VkSparseImageMemoryBind.Buffercreate(long address, int capacity)Create aVkSparseImageMemoryBind.Bufferinstance at the specified memory.static VkSparseImageMemoryBindcreateSafe(long address)static VkSparseImageMemoryBind.BuffercreateSafe(long address, int capacity)VkExtent3Dextent()Returns aVkExtent3Dview of theextentfield.VkSparseImageMemoryBindextent(java.util.function.Consumer<VkExtent3D> consumer)Passes theextentfield to the specifiedConsumer.VkSparseImageMemoryBindextent(VkExtent3D value)Copies the specifiedVkExtent3Dto theextentfield.intflags()Returns the value of theflagsfield.VkSparseImageMemoryBindflags(int value)Sets the specified value to theflagsfield.static VkSparseImageMemoryBindmalloc()Returns a newVkSparseImageMemoryBindinstance allocated withmemAlloc.static VkSparseImageMemoryBind.Buffermalloc(int capacity)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated withmemAlloc.static VkSparseImageMemoryBindmallocStack()Returns a newVkSparseImageMemoryBindinstance allocated on the thread-localMemoryStack.static VkSparseImageMemoryBind.BuffermallocStack(int capacity)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the thread-localMemoryStack.static VkSparseImageMemoryBind.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the specifiedMemoryStack.static VkSparseImageMemoryBindmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkSparseImageMemoryBindinstance allocated on the specifiedMemoryStack.longmemory()Returns the value of thememoryfield.VkSparseImageMemoryBindmemory(long value)Sets the specified value to thememoryfield.longmemoryOffset()Returns the value of thememoryOffsetfield.VkSparseImageMemoryBindmemoryOffset(long value)Sets the specified value to thememoryOffsetfield.static VkExtent3Dnextent(long struct)Unsafe version ofextent().static voidnextent(long struct, VkExtent3D value)Unsafe version ofextent.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 VkOffset3Dnoffset(long struct)Unsafe version ofoffset().static voidnoffset(long struct, VkOffset3D value)Unsafe version ofoffset.static VkImageSubresourcensubresource(long struct)Unsafe version ofsubresource().static voidnsubresource(long struct, VkImageSubresource value)Unsafe version ofsubresource.VkOffset3Doffset()Returns aVkOffset3Dview of theoffsetfield.VkSparseImageMemoryBindoffset(java.util.function.Consumer<VkOffset3D> consumer)Passes theoffsetfield to the specifiedConsumer.VkSparseImageMemoryBindoffset(VkOffset3D value)Copies the specifiedVkOffset3Dto theoffsetfield.VkSparseImageMemoryBindset(VkImageSubresource subresource, VkOffset3D offset, VkExtent3D extent, long memory, long memoryOffset, int flags)Initializes this struct with the specified values.VkSparseImageMemoryBindset(VkSparseImageMemoryBind src)Copies the specified struct data to this struct.intsizeof()VkImageSubresourcesubresource()Returns aVkImageSubresourceview of thesubresourcefield.VkSparseImageMemoryBindsubresource(java.util.function.Consumer<VkImageSubresource> consumer)Passes thesubresourcefield to the specifiedConsumer.VkSparseImageMemoryBindsubresource(VkImageSubresource value)Copies the specifiedVkImageSubresourceto thesubresourcefield.
-
-
-
Constructor Detail
-
VkSparseImageMemoryBind
public VkSparseImageMemoryBind(java.nio.ByteBuffer container)
Creates aVkSparseImageMemoryBindinstance 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
-
subresource
public VkImageSubresource subresource()
Returns aVkImageSubresourceview of thesubresourcefield.
-
offset
public VkOffset3D offset()
Returns aVkOffset3Dview of theoffsetfield.
-
extent
public VkExtent3D extent()
Returns aVkExtent3Dview of theextentfield.
-
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.
-
subresource
public VkSparseImageMemoryBind subresource(VkImageSubresource value)
Copies the specifiedVkImageSubresourceto thesubresourcefield.
-
subresource
public VkSparseImageMemoryBind subresource(java.util.function.Consumer<VkImageSubresource> consumer)
Passes thesubresourcefield to the specifiedConsumer.
-
offset
public VkSparseImageMemoryBind offset(VkOffset3D value)
Copies the specifiedVkOffset3Dto theoffsetfield.
-
offset
public VkSparseImageMemoryBind offset(java.util.function.Consumer<VkOffset3D> consumer)
Passes theoffsetfield to the specifiedConsumer.
-
extent
public VkSparseImageMemoryBind extent(VkExtent3D value)
Copies the specifiedVkExtent3Dto theextentfield.
-
extent
public VkSparseImageMemoryBind extent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theextentfield to the specifiedConsumer.
-
memory
public VkSparseImageMemoryBind memory(long value)
Sets the specified value to thememoryfield.
-
memoryOffset
public VkSparseImageMemoryBind memoryOffset(long value)
Sets the specified value to thememoryOffsetfield.
-
flags
public VkSparseImageMemoryBind flags(int value)
Sets the specified value to theflagsfield.
-
set
public VkSparseImageMemoryBind set(VkImageSubresource subresource, VkOffset3D offset, VkExtent3D extent, long memory, long memoryOffset, int flags)
Initializes this struct with the specified values.
-
set
public VkSparseImageMemoryBind set(VkSparseImageMemoryBind src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static VkSparseImageMemoryBind malloc()
Returns a newVkSparseImageMemoryBindinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkSparseImageMemoryBind calloc()
Returns a newVkSparseImageMemoryBindinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkSparseImageMemoryBind create()
Returns a newVkSparseImageMemoryBindinstance allocated withBufferUtils.
-
create
public static VkSparseImageMemoryBind create(long address)
Returns a newVkSparseImageMemoryBindinstance for the specified memory address.
-
createSafe
@Nullable public static VkSparseImageMemoryBind createSafe(long address)
-
malloc
public static VkSparseImageMemoryBind.Buffer malloc(int capacity)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkSparseImageMemoryBind.Buffer calloc(int capacity)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkSparseImageMemoryBind.Buffer create(int capacity)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkSparseImageMemoryBind.Buffer create(long address, int capacity)
Create aVkSparseImageMemoryBind.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkSparseImageMemoryBind.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkSparseImageMemoryBind mallocStack()
Returns a newVkSparseImageMemoryBindinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkSparseImageMemoryBind callocStack()
Returns a newVkSparseImageMemoryBindinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkSparseImageMemoryBind mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBindinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkSparseImageMemoryBind callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBindinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static VkSparseImageMemoryBind.Buffer mallocStack(int capacity)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkSparseImageMemoryBind.Buffer callocStack(int capacity)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkSparseImageMemoryBind.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkSparseImageMemoryBind.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nsubresource
public static VkImageSubresource nsubresource(long struct)
Unsafe version ofsubresource().
-
noffset
public static VkOffset3D noffset(long struct)
Unsafe version ofoffset().
-
nextent
public static VkExtent3D nextent(long struct)
Unsafe version ofextent().
-
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().
-
nsubresource
public static void nsubresource(long struct, VkImageSubresource value)Unsafe version ofsubresource.
-
noffset
public static void noffset(long struct, VkOffset3D value)Unsafe version ofoffset.
-
nextent
public static void nextent(long struct, VkExtent3D value)Unsafe version ofextent.
-
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.
-
-