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.NativeResource
Structure 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 ofmemory
being bound must not overlap with those bound ranges memory
andmemoryOffset
must match the memory requirements of the calling command’simage
, as described in section Resource Memory Associationsubresource
must be a valid image subresource forimage
(see Image Views)offset.x
must be a multiple of the sparse image block width (VkSparseImageFormatProperties
::imageGranularity
.width) of the imageextent.width
must 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.y
must be a multiple of the sparse image block height (VkSparseImageFormatProperties
::imageGranularity
.height) of the imageextent.height
must 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.z
must be a multiple of the sparse image block depth (VkSparseImageFormatProperties
::imageGranularity
.depth) of the imageextent.depth
must 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
memory
was created withVkExportMemoryAllocateInfo
::handleTypes
not equal to 0, at least one handle type it contained must also have been set inVkExternalMemoryImageCreateInfo
::handleTypes
when the image was created. - If
memory
was created by a memory import operation, the external handle type of the imported memory must also have been set inVkExternalMemoryImageCreateInfo
::handleTypes
whenimage
was created.
Valid Usage (Implicit)
subresource
must be a validVkImageSubresource
structure- If
memory
is notNULL_HANDLE
,memory
must be a validVkDeviceMemory
handle flags
must be a valid combination ofVkSparseMemoryBindFlagBits
values
See Also
VkExtent3D
,VkImageSubresource
,VkOffset3D
,VkSparseImageMemoryBindInfo
Member 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 + extent
equals the corresponding dimensions of the image subresource.memory
– theVkDeviceMemory
object that the sparse image blocks of the image are bound to. Ifmemory
isNULL_HANDLE
, the sparse image blocks are unbound.memoryOffset
– an offset intoVkDeviceMemory
object. Ifmemory
isNULL_HANDLE
, this value is ignored.flags
– are sparse memory binding flags.
Layout
struct VkSparseImageMemoryBind {
VkImageSubresource
subresource;VkOffset3D
offset;VkExtent3D
extent; VkDeviceMemory memory; VkDeviceSize memoryOffset; VkSparseMemoryBindFlags flags; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkSparseImageMemoryBind.Buffer
An array ofVkSparseImageMemoryBind
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
EXTENT
FLAGS
MEMORY
MEMORYOFFSET
OFFSETThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
SUBRESOURCE
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description VkSparseImageMemoryBind(java.nio.ByteBuffer container)
Creates aVkSparseImageMemoryBind
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 VkSparseImageMemoryBind
calloc()
Returns a newVkSparseImageMemoryBind
instance allocated withmemCalloc
.static VkSparseImageMemoryBind.Buffer
calloc(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated withmemCalloc
.static VkSparseImageMemoryBind
callocStack()
Returns a newVkSparseImageMemoryBind
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSparseImageMemoryBind.Buffer
callocStack(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkSparseImageMemoryBind.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkSparseImageMemoryBind
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkSparseImageMemoryBind
create()
Returns a newVkSparseImageMemoryBind
instance allocated withBufferUtils
.static VkSparseImageMemoryBind.Buffer
create(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated withBufferUtils
.static VkSparseImageMemoryBind
create(long address)
Returns a newVkSparseImageMemoryBind
instance for the specified memory address.static VkSparseImageMemoryBind.Buffer
create(long address, int capacity)
Create aVkSparseImageMemoryBind.Buffer
instance at the specified memory.static VkSparseImageMemoryBind
createSafe(long address)
static VkSparseImageMemoryBind.Buffer
createSafe(long address, int capacity)
VkExtent3D
extent()
Returns aVkExtent3D
view of theextent
field.VkSparseImageMemoryBind
extent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theextent
field to the specifiedConsumer
.VkSparseImageMemoryBind
extent(VkExtent3D value)
Copies the specifiedVkExtent3D
to theextent
field.int
flags()
Returns the value of theflags
field.VkSparseImageMemoryBind
flags(int value)
Sets the specified value to theflags
field.static VkSparseImageMemoryBind
malloc()
Returns a newVkSparseImageMemoryBind
instance allocated withmemAlloc
.static VkSparseImageMemoryBind.Buffer
malloc(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated withmemAlloc
.static VkSparseImageMemoryBind
mallocStack()
Returns a newVkSparseImageMemoryBind
instance allocated on the thread-localMemoryStack
.static VkSparseImageMemoryBind.Buffer
mallocStack(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
.static VkSparseImageMemoryBind.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated on the specifiedMemoryStack
.static VkSparseImageMemoryBind
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind
instance allocated on the specifiedMemoryStack
.long
memory()
Returns the value of thememory
field.VkSparseImageMemoryBind
memory(long value)
Sets the specified value to thememory
field.long
memoryOffset()
Returns the value of thememoryOffset
field.VkSparseImageMemoryBind
memoryOffset(long value)
Sets the specified value to thememoryOffset
field.static VkExtent3D
nextent(long struct)
Unsafe version ofextent()
.static void
nextent(long struct, VkExtent3D value)
Unsafe version ofextent
.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 VkOffset3D
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, VkOffset3D value)
Unsafe version ofoffset
.static VkImageSubresource
nsubresource(long struct)
Unsafe version ofsubresource()
.static void
nsubresource(long struct, VkImageSubresource value)
Unsafe version ofsubresource
.VkOffset3D
offset()
Returns aVkOffset3D
view of theoffset
field.VkSparseImageMemoryBind
offset(java.util.function.Consumer<VkOffset3D> consumer)
Passes theoffset
field to the specifiedConsumer
.VkSparseImageMemoryBind
offset(VkOffset3D value)
Copies the specifiedVkOffset3D
to theoffset
field.VkSparseImageMemoryBind
set(VkImageSubresource subresource, VkOffset3D offset, VkExtent3D extent, long memory, long memoryOffset, int flags)
Initializes this struct with the specified values.VkSparseImageMemoryBind
set(VkSparseImageMemoryBind src)
Copies the specified struct data to this struct.int
sizeof()
VkImageSubresource
subresource()
Returns aVkImageSubresource
view of thesubresource
field.VkSparseImageMemoryBind
subresource(java.util.function.Consumer<VkImageSubresource> consumer)
Passes thesubresource
field to the specifiedConsumer
.VkSparseImageMemoryBind
subresource(VkImageSubresource value)
Copies the specifiedVkImageSubresource
to thesubresource
field.
-
-
-
Constructor Detail
-
VkSparseImageMemoryBind
public VkSparseImageMemoryBind(java.nio.ByteBuffer container)
Creates aVkSparseImageMemoryBind
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
-
subresource
public VkImageSubresource subresource()
Returns aVkImageSubresource
view of thesubresource
field.
-
offset
public VkOffset3D offset()
Returns aVkOffset3D
view of theoffset
field.
-
extent
public VkExtent3D extent()
Returns aVkExtent3D
view of theextent
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.
-
subresource
public VkSparseImageMemoryBind subresource(VkImageSubresource value)
Copies the specifiedVkImageSubresource
to thesubresource
field.
-
subresource
public VkSparseImageMemoryBind subresource(java.util.function.Consumer<VkImageSubresource> consumer)
Passes thesubresource
field to the specifiedConsumer
.
-
offset
public VkSparseImageMemoryBind offset(VkOffset3D value)
Copies the specifiedVkOffset3D
to theoffset
field.
-
offset
public VkSparseImageMemoryBind offset(java.util.function.Consumer<VkOffset3D> consumer)
Passes theoffset
field to the specifiedConsumer
.
-
extent
public VkSparseImageMemoryBind extent(VkExtent3D value)
Copies the specifiedVkExtent3D
to theextent
field.
-
extent
public VkSparseImageMemoryBind extent(java.util.function.Consumer<VkExtent3D> consumer)
Passes theextent
field to the specifiedConsumer
.
-
memory
public VkSparseImageMemoryBind memory(long value)
Sets the specified value to thememory
field.
-
memoryOffset
public VkSparseImageMemoryBind memoryOffset(long value)
Sets the specified value to thememoryOffset
field.
-
flags
public VkSparseImageMemoryBind flags(int value)
Sets the specified value to theflags
field.
-
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 newVkSparseImageMemoryBind
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkSparseImageMemoryBind calloc()
Returns a newVkSparseImageMemoryBind
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkSparseImageMemoryBind create()
Returns a newVkSparseImageMemoryBind
instance allocated withBufferUtils
.
-
create
public static VkSparseImageMemoryBind create(long address)
Returns a newVkSparseImageMemoryBind
instance for the specified memory address.
-
createSafe
@Nullable public static VkSparseImageMemoryBind createSafe(long address)
-
malloc
public static VkSparseImageMemoryBind.Buffer malloc(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkSparseImageMemoryBind.Buffer calloc(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSparseImageMemoryBind.Buffer create(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkSparseImageMemoryBind.Buffer create(long address, int capacity)
Create aVkSparseImageMemoryBind.Buffer
instance 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 newVkSparseImageMemoryBind
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkSparseImageMemoryBind callocStack()
Returns a newVkSparseImageMemoryBind
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkSparseImageMemoryBind mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkSparseImageMemoryBind callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkSparseImageMemoryBind
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkSparseImageMemoryBind.Buffer callocStack(int capacity)
Returns a newVkSparseImageMemoryBind.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-