Class VkMemoryAllocateFlagsInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkMemoryAllocateFlagsInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
- Direct Known Subclasses:
VkMemoryAllocateFlagsInfoKHR
public class VkMemoryAllocateFlagsInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure controlling how many instances of memory will be allocated.Description
If
MEMORY_ALLOCATE_DEVICE_MASK_BIT
is not set, the number of instances allocated depends on whetherMEMORY_HEAP_MULTI_INSTANCE_BIT
is set in the memory heap. IfMEMORY_HEAP_MULTI_INSTANCE_BIT
is set, then memory is allocated for every physical device in the logical device (as ifdeviceMask
has bits set for all device indices). IfMEMORY_HEAP_MULTI_INSTANCE_BIT
is not set, then a single instance of memory is allocated (as ifdeviceMask
is set to one).On some implementations, allocations from a multi-instance heap may consume memory on all physical devices even if the
deviceMask
excludes some devices. IfVkPhysicalDeviceGroupProperties
::subsetAllocation
isTRUE
, then memory is only consumed for the devices in the device mask.Note
In practice, most allocations on a multi-instance heap will be allocated across all physical devices. Unicast allocation support is an optional optimization for a minority of allocations.
Valid Usage
- If
MEMORY_ALLOCATE_DEVICE_MASK_BIT
is set,deviceMask
must be a valid device mask. - If
MEMORY_ALLOCATE_DEVICE_MASK_BIT
is set,deviceMask
must not be zero
Valid Usage (Implicit)
sType
must beSTRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO
flags
must be a valid combination ofVkMemoryAllocateFlagBits
values
Member documentation
sType
– the type of this structure.pNext
–NULL
or a pointer to an extension-specific structure.flags
– a bitmask ofVkMemoryAllocateFlagBits
controlling the allocation.deviceMask
– a mask of physical devices in the logical device, indicating that memory must be allocated on each device in the mask, ifMEMORY_ALLOCATE_DEVICE_MASK_BIT
is set inflags
.
Layout
struct VkMemoryAllocateFlagsInfo { VkStructureType sType; void const * pNext; VkMemoryAllocateFlags flags; uint32_t deviceMask; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VkMemoryAllocateFlagsInfo.Buffer
An array ofVkMemoryAllocateFlagsInfo
structs.
-
Constructor Summary
Constructors Constructor Description VkMemoryAllocateFlagsInfo(java.nio.ByteBuffer container)
Creates aVkMemoryAllocateFlagsInfo
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 VkMemoryAllocateFlagsInfo
calloc()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated withmemCalloc
.static VkMemoryAllocateFlagsInfo.Buffer
calloc(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated withmemCalloc
.static VkMemoryAllocateFlagsInfo
callocStack()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkMemoryAllocateFlagsInfo.Buffer
callocStack(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkMemoryAllocateFlagsInfo.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkMemoryAllocateFlagsInfo
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkMemoryAllocateFlagsInfo
create()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated withBufferUtils
.static VkMemoryAllocateFlagsInfo.Buffer
create(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated withBufferUtils
.static VkMemoryAllocateFlagsInfo
create(long address)
Returns a newVkMemoryAllocateFlagsInfo
instance for the specified memory address.static VkMemoryAllocateFlagsInfo.Buffer
create(long address, int capacity)
Create aVkMemoryAllocateFlagsInfo.Buffer
instance at the specified memory.static VkMemoryAllocateFlagsInfo
createSafe(long address)
static VkMemoryAllocateFlagsInfo.Buffer
createSafe(long address, int capacity)
int
deviceMask()
Returns the value of thedeviceMask
field.VkMemoryAllocateFlagsInfo
deviceMask(int value)
Sets the specified value to thedeviceMask
field.int
flags()
Returns the value of theflags
field.VkMemoryAllocateFlagsInfo
flags(int value)
Sets the specified value to theflags
field.static VkMemoryAllocateFlagsInfo
malloc()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated withmemAlloc
.static VkMemoryAllocateFlagsInfo.Buffer
malloc(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated withmemAlloc
.static VkMemoryAllocateFlagsInfo
mallocStack()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the thread-localMemoryStack
.static VkMemoryAllocateFlagsInfo.Buffer
mallocStack(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the thread-localMemoryStack
.static VkMemoryAllocateFlagsInfo.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the specifiedMemoryStack
.static VkMemoryAllocateFlagsInfo
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the specifiedMemoryStack
.static int
ndeviceMask(long struct)
Unsafe version ofdeviceMask()
.static void
ndeviceMask(long struct, int value)
Unsafe version ofdeviceMask
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.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.VkMemoryAllocateFlagsInfo
pNext(long value)
Sets the specified value to thepNext
field.VkMemoryAllocateFlagsInfo
set(int sType, long pNext, int flags, int deviceMask)
Initializes this struct with the specified values.VkMemoryAllocateFlagsInfo
set(VkMemoryAllocateFlagsInfo src)
Copies the specified struct data to this struct.int
sizeof()
int
sType()
Returns the value of thesType
field.VkMemoryAllocateFlagsInfo
sType(int value)
Sets the specified value to thesType
field.
-
-
-
Constructor Detail
-
VkMemoryAllocateFlagsInfo
public VkMemoryAllocateFlagsInfo(java.nio.ByteBuffer container)
Creates aVkMemoryAllocateFlagsInfo
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.
-
flags
public int flags()
Returns the value of theflags
field.
-
deviceMask
public int deviceMask()
Returns the value of thedeviceMask
field.
-
sType
public VkMemoryAllocateFlagsInfo sType(int value)
Sets the specified value to thesType
field.
-
pNext
public VkMemoryAllocateFlagsInfo pNext(long value)
Sets the specified value to thepNext
field.
-
flags
public VkMemoryAllocateFlagsInfo flags(int value)
Sets the specified value to theflags
field.
-
deviceMask
public VkMemoryAllocateFlagsInfo deviceMask(int value)
Sets the specified value to thedeviceMask
field.
-
set
public VkMemoryAllocateFlagsInfo set(int sType, long pNext, int flags, int deviceMask)
Initializes this struct with the specified values.
-
set
public VkMemoryAllocateFlagsInfo set(VkMemoryAllocateFlagsInfo src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkMemoryAllocateFlagsInfo malloc()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkMemoryAllocateFlagsInfo calloc()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkMemoryAllocateFlagsInfo create()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated withBufferUtils
.
-
create
public static VkMemoryAllocateFlagsInfo create(long address)
Returns a newVkMemoryAllocateFlagsInfo
instance for the specified memory address.
-
createSafe
@Nullable public static VkMemoryAllocateFlagsInfo createSafe(long address)
-
malloc
public static VkMemoryAllocateFlagsInfo.Buffer malloc(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkMemoryAllocateFlagsInfo.Buffer calloc(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkMemoryAllocateFlagsInfo.Buffer create(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkMemoryAllocateFlagsInfo.Buffer create(long address, int capacity)
Create aVkMemoryAllocateFlagsInfo.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VkMemoryAllocateFlagsInfo.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkMemoryAllocateFlagsInfo mallocStack()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkMemoryAllocateFlagsInfo callocStack()
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkMemoryAllocateFlagsInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkMemoryAllocateFlagsInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkMemoryAllocateFlagsInfo.Buffer mallocStack(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkMemoryAllocateFlagsInfo.Buffer callocStack(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkMemoryAllocateFlagsInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkMemoryAllocateFlagsInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfo.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()
.
-
nflags
public static int nflags(long struct)
Unsafe version offlags()
.
-
ndeviceMask
public static int ndeviceMask(long struct)
Unsafe version ofdeviceMask()
.
-
nsType
public static void nsType(long struct, int value)
Unsafe version ofsType
.
-
npNext
public static void npNext(long struct, long value)
Unsafe version ofpNext
.
-
nflags
public static void nflags(long struct, int value)
Unsafe version offlags
.
-
ndeviceMask
public static void ndeviceMask(long struct, int value)
Unsafe version ofdeviceMask
.
-
-