Package org.lwjgl.vulkan
Class VkBindBufferMemoryInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkBindBufferMemoryInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkBindBufferMemoryInfoKHR
public class VkBindBufferMemoryInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure specifying how to bind a buffer to memory.Valid Usage
buffer
must not already be backed by a memory objectbuffer
must not have been created with any sparse memory binding flagsmemoryOffset
must be less than the size ofmemory
memory
must have been allocated using one of the memory types allowed in thememoryTypeBits
member of theVkMemoryRequirements
structure returned from a call tovkGetBufferMemoryRequirements
withbuffer
memoryOffset
must be an integer multiple of thealignment
member of theVkMemoryRequirements
structure returned from a call tovkGetBufferMemoryRequirements
withbuffer
- The
size
member of theVkMemoryRequirements
structure returned from a call tovkGetBufferMemoryRequirements
withbuffer
must be less than or equal to the size ofmemory
minusmemoryOffset
- If
buffer
requires a dedicated allocation(as reported byGetBufferMemoryRequirements2
inVkMemoryDedicatedRequirements
::requiresDedicatedAllocation forbuffer
),memory
must have been created withVkMemoryDedicatedAllocateInfo
::buffer
equal tobuffer
andmemoryOffset
must be zero - If the
VkMemoryAllocateInfo
provided whenmemory
was allocated included an instance ofVkMemoryDedicatedAllocateInfo
in itspNext
chain, andVkMemoryDedicatedAllocateInfo
::buffer
was notNULL_HANDLE
, thenbuffer
must equalVkMemoryDedicatedAllocateInfo
::buffer
andmemoryOffset
must be zero. - If
buffer
was created withVkDedicatedAllocationBufferCreateInfoNV
::dedicatedAllocation
equal toTRUE
,memory
must have been created withVkDedicatedAllocationMemoryAllocateInfoNV
::buffer
equal tobuffer
andmemoryOffset
must be zero - If the
pNext
chain includesVkBindBufferMemoryDeviceGroupInfo
, all instances ofmemory
specified byVkBindBufferMemoryDeviceGroupInfo
::pDeviceIndices
must have been allocated - If the value of
VkExportMemoryAllocateInfo
::handleTypes
used to allocatememory
is not 0, it must include at least one of the handles set inVkExternalMemoryImageCreateInfo
::handleTypes
whenimage
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
whenbuffer
was created
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO
pNext
must beNULL
or a pointer to a valid instance ofVkBindBufferMemoryDeviceGroupInfo
buffer
must be a validVkBuffer
handlememory
must be a validVkDeviceMemory
handle- Both of
buffer
, andmemory
must have been created, allocated, or retrieved from the sameVkDevice
See Also
BindBufferMemory2
,BindBufferMemory2KHR
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.buffer
– the buffer to be attached to memory.memory
– aVkDeviceMemory
object describing the device memory to attach.memoryOffset
– the start offset of the region ofmemory
which is to be bound to the buffer. The number of bytes returned in theVkMemoryRequirements
::size
member inmemory
, starting frommemoryOffset
bytes, will be bound to the specified buffer.
Layout
struct VkBindBufferMemoryInfo { VkStructureType sType; void const * pNext; VkBuffer buffer; VkDeviceMemory memory; VkDeviceSize memoryOffset; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkBindBufferMemoryInfo.Buffer
An array ofVkBindBufferMemoryInfo
structs.
-
Constructor Summary
Constructors Constructor Description VkBindBufferMemoryInfo(java.nio.ByteBuffer container)
Creates aVkBindBufferMemoryInfo
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
buffer()
Returns the value of thebuffer
field.VkBindBufferMemoryInfo
buffer(long value)
Sets the specified value to thebuffer
field.static VkBindBufferMemoryInfo
calloc()
Returns a newVkBindBufferMemoryInfo
instance allocated withmemCalloc
.static VkBindBufferMemoryInfo.Buffer
calloc(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated withmemCalloc
.static VkBindBufferMemoryInfo
callocStack()
Returns a newVkBindBufferMemoryInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBindBufferMemoryInfo.Buffer
callocStack(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkBindBufferMemoryInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBindBufferMemoryInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkBindBufferMemoryInfo
create()
Returns a newVkBindBufferMemoryInfo
instance allocated withBufferUtils
.static VkBindBufferMemoryInfo.Buffer
create(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated withBufferUtils
.static VkBindBufferMemoryInfo
create(long address)
Returns a newVkBindBufferMemoryInfo
instance for the specified memory address.static VkBindBufferMemoryInfo.Buffer
create(long address, int capacity)
Create aVkBindBufferMemoryInfo.Buffer
instance at the specified memory.static VkBindBufferMemoryInfo
createSafe(long address)
static VkBindBufferMemoryInfo.Buffer
createSafe(long address, int capacity)
static VkBindBufferMemoryInfo
malloc()
Returns a newVkBindBufferMemoryInfo
instance allocated withmemAlloc
.static VkBindBufferMemoryInfo.Buffer
malloc(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated withmemAlloc
.static VkBindBufferMemoryInfo
mallocStack()
Returns a newVkBindBufferMemoryInfo
instance allocated on the thread-localMemoryStack
.static VkBindBufferMemoryInfo.Buffer
mallocStack(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkBindBufferMemoryInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkBindBufferMemoryInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo
instance allocated on the specifiedMemoryStack
.long
memory()
Returns the value of thememory
field.VkBindBufferMemoryInfo
memory(long value)
Sets the specified value to thememory
field.long
memoryOffset()
Returns the value of thememoryOffset
field.VkBindBufferMemoryInfo
memoryOffset(long value)
Sets the specified value to thememoryOffset
field.static long
nbuffer(long struct)
Unsafe version ofbuffer()
.static void
nbuffer(long struct, long value)
Unsafe version ofbuffer
.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
npNext(long struct)
Unsafe version ofpNext()
.static void
npNext(long struct, long value)
Unsafe version ofpNext
.static int
nsType(long struct)
Unsafe version ofsType()
.static void
nsType(long struct, int value)
Unsafe version ofsType
.long
pNext()
Returns the value of thepNext
field.VkBindBufferMemoryInfo
pNext(long value)
Sets the specified value to thepNext
field.VkBindBufferMemoryInfo
set(int sType, long pNext, long buffer, long memory, long memoryOffset)
Initializes this struct with the specified values.VkBindBufferMemoryInfo
set(VkBindBufferMemoryInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkBindBufferMemoryInfo
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkBindBufferMemoryInfo
public VkBindBufferMemoryInfo(java.nio.ByteBuffer container)
Creates aVkBindBufferMemoryInfo
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
-
sType
public int sType()
Returns the value of thesType
field.
-
pNext
public long pNext()
Returns the value of thepNext
field.
-
buffer
public long buffer()
Returns the value of thebuffer
field.
-
memory
public long memory()
Returns the value of thememory
field.
-
memoryOffset
public long memoryOffset()
Returns the value of thememoryOffset
field.
-
sType
public VkBindBufferMemoryInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkBindBufferMemoryInfo pNext(long value)
Sets the specified value to thepNext
field.
-
buffer
public VkBindBufferMemoryInfo buffer(long value)
Sets the specified value to thebuffer
field.
-
memory
public VkBindBufferMemoryInfo memory(long value)
Sets the specified value to thememory
field.
-
memoryOffset
public VkBindBufferMemoryInfo memoryOffset(long value)
Sets the specified value to thememoryOffset
field.
-
set
public VkBindBufferMemoryInfo set(int sType, long pNext, long buffer, long memory, long memoryOffset)
Initializes this struct with the specified values.
-
set
public VkBindBufferMemoryInfo set(VkBindBufferMemoryInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkBindBufferMemoryInfo malloc()
Returns a newVkBindBufferMemoryInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkBindBufferMemoryInfo calloc()
Returns a newVkBindBufferMemoryInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkBindBufferMemoryInfo create()
Returns a newVkBindBufferMemoryInfo
instance allocated withBufferUtils
.
-
create
public static VkBindBufferMemoryInfo create(long address)
Returns a newVkBindBufferMemoryInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkBindBufferMemoryInfo createSafe(long address)
-
malloc
public static VkBindBufferMemoryInfo.Buffer malloc(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkBindBufferMemoryInfo.Buffer calloc(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBindBufferMemoryInfo.Buffer create(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkBindBufferMemoryInfo.Buffer create(long address, int capacity)
Create aVkBindBufferMemoryInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkBindBufferMemoryInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkBindBufferMemoryInfo mallocStack()
Returns a newVkBindBufferMemoryInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkBindBufferMemoryInfo callocStack()
Returns a newVkBindBufferMemoryInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkBindBufferMemoryInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkBindBufferMemoryInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkBindBufferMemoryInfo.Buffer mallocStack(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkBindBufferMemoryInfo.Buffer callocStack(int capacity)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkBindBufferMemoryInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkBindBufferMemoryInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkBindBufferMemoryInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nsType
public static int nsType(long struct)
Unsafe version ofsType()
.
-
npNext
public static long npNext(long struct)
Unsafe version ofpNext()
.
-
nbuffer
public static long nbuffer(long struct)
Unsafe version ofbuffer()
.
-
nmemory
public static long nmemory(long struct)
Unsafe version ofmemory()
.
-
nmemoryOffset
public static long nmemoryOffset(long struct)
Unsafe version ofmemoryOffset()
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nbuffer
public static void nbuffer(long struct, long value)
Unsafe version ofbuffer
.
-
nmemory
public static void nmemory(long struct, long value)
Unsafe version ofmemory
.
-
nmemoryOffset
public static void nmemoryOffset(long struct, long value)
Unsafe version ofmemoryOffset
.
-
-