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.NativeResourceStructure controlling how many instances of memory will be allocated.Description
If
MEMORY_ALLOCATE_DEVICE_MASK_BITis not set, the number of instances allocated depends on whetherMEMORY_HEAP_MULTI_INSTANCE_BITis set in the memory heap. IfMEMORY_HEAP_MULTI_INSTANCE_BITis set, then memory is allocated for every physical device in the logical device (as ifdeviceMaskhas bits set for all device indices). IfMEMORY_HEAP_MULTI_INSTANCE_BITis not set, then a single instance of memory is allocated (as ifdeviceMaskis set to one).On some implementations, allocations from a multi-instance heap may consume memory on all physical devices even if the
deviceMaskexcludes some devices. IfVkPhysicalDeviceGroupProperties::subsetAllocationisTRUE, 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_BITis set,deviceMaskmust be a valid device mask. - If
MEMORY_ALLOCATE_DEVICE_MASK_BITis set,deviceMaskmust not be zero
Valid Usage (Implicit)
sTypemust beSTRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFOflagsmust be a valid combination ofVkMemoryAllocateFlagBitsvalues
Member documentation
sType– the type of this structure.pNext–NULLor a pointer to an extension-specific structure.flags– a bitmask ofVkMemoryAllocateFlagBitscontrolling 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_BITis 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 classVkMemoryAllocateFlagsInfo.BufferAn array ofVkMemoryAllocateFlagsInfostructs.
-
Constructor Summary
Constructors Constructor Description VkMemoryAllocateFlagsInfo(java.nio.ByteBuffer container)Creates aVkMemoryAllocateFlagsInfoinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VkMemoryAllocateFlagsInfocalloc()Returns a newVkMemoryAllocateFlagsInfoinstance allocated withmemCalloc.static VkMemoryAllocateFlagsInfo.Buffercalloc(int capacity)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated withmemCalloc.static VkMemoryAllocateFlagsInfocallocStack()Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkMemoryAllocateFlagsInfo.BuffercallocStack(int capacity)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkMemoryAllocateFlagsInfo.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkMemoryAllocateFlagsInfocallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkMemoryAllocateFlagsInfocreate()Returns a newVkMemoryAllocateFlagsInfoinstance allocated withBufferUtils.static VkMemoryAllocateFlagsInfo.Buffercreate(int capacity)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated withBufferUtils.static VkMemoryAllocateFlagsInfocreate(long address)Returns a newVkMemoryAllocateFlagsInfoinstance for the specified memory address.static VkMemoryAllocateFlagsInfo.Buffercreate(long address, int capacity)Create aVkMemoryAllocateFlagsInfo.Bufferinstance at the specified memory.static VkMemoryAllocateFlagsInfocreateSafe(long address)static VkMemoryAllocateFlagsInfo.BuffercreateSafe(long address, int capacity)intdeviceMask()Returns the value of thedeviceMaskfield.VkMemoryAllocateFlagsInfodeviceMask(int value)Sets the specified value to thedeviceMaskfield.intflags()Returns the value of theflagsfield.VkMemoryAllocateFlagsInfoflags(int value)Sets the specified value to theflagsfield.static VkMemoryAllocateFlagsInfomalloc()Returns a newVkMemoryAllocateFlagsInfoinstance allocated withmemAlloc.static VkMemoryAllocateFlagsInfo.Buffermalloc(int capacity)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated withmemAlloc.static VkMemoryAllocateFlagsInfomallocStack()Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the thread-localMemoryStack.static VkMemoryAllocateFlagsInfo.BuffermallocStack(int capacity)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated on the thread-localMemoryStack.static VkMemoryAllocateFlagsInfo.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated on the specifiedMemoryStack.static VkMemoryAllocateFlagsInfomallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the specifiedMemoryStack.static intndeviceMask(long struct)Unsafe version ofdeviceMask().static voidndeviceMask(long struct, int value)Unsafe version ofdeviceMask.static intnflags(long struct)Unsafe version offlags().static voidnflags(long struct, int value)Unsafe version offlags.static longnpNext(long struct)Unsafe version ofpNext().static voidnpNext(long struct, long value)Unsafe version ofpNext.static intnsType(long struct)Unsafe version ofsType().static voidnsType(long struct, int value)Unsafe version ofsType.longpNext()Returns the value of thepNextfield.VkMemoryAllocateFlagsInfopNext(long value)Sets the specified value to thepNextfield.VkMemoryAllocateFlagsInfoset(int sType, long pNext, int flags, int deviceMask)Initializes this struct with the specified values.VkMemoryAllocateFlagsInfoset(VkMemoryAllocateFlagsInfo src)Copies the specified struct data to this struct.intsizeof()intsType()Returns the value of thesTypefield.VkMemoryAllocateFlagsInfosType(int value)Sets the specified value to thesTypefield.
-
-
-
Constructor Detail
-
VkMemoryAllocateFlagsInfo
public VkMemoryAllocateFlagsInfo(java.nio.ByteBuffer container)
Creates aVkMemoryAllocateFlagsInfoinstance 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
-
sType
public int sType()
Returns the value of thesTypefield.
-
pNext
public long pNext()
Returns the value of thepNextfield.
-
flags
public int flags()
Returns the value of theflagsfield.
-
deviceMask
public int deviceMask()
Returns the value of thedeviceMaskfield.
-
sType
public VkMemoryAllocateFlagsInfo sType(int value)
Sets the specified value to thesTypefield.
-
pNext
public VkMemoryAllocateFlagsInfo pNext(long value)
Sets the specified value to thepNextfield.
-
flags
public VkMemoryAllocateFlagsInfo flags(int value)
Sets the specified value to theflagsfield.
-
deviceMask
public VkMemoryAllocateFlagsInfo deviceMask(int value)
Sets the specified value to thedeviceMaskfield.
-
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 newVkMemoryAllocateFlagsInfoinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkMemoryAllocateFlagsInfo calloc()
Returns a newVkMemoryAllocateFlagsInfoinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkMemoryAllocateFlagsInfo create()
Returns a newVkMemoryAllocateFlagsInfoinstance allocated withBufferUtils.
-
create
public static VkMemoryAllocateFlagsInfo create(long address)
Returns a newVkMemoryAllocateFlagsInfoinstance for the specified memory address.
-
createSafe
@Nullable public static VkMemoryAllocateFlagsInfo createSafe(long address)
-
malloc
public static VkMemoryAllocateFlagsInfo.Buffer malloc(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkMemoryAllocateFlagsInfo.Buffer calloc(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkMemoryAllocateFlagsInfo.Buffer create(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkMemoryAllocateFlagsInfo.Buffer create(long address, int capacity)
Create aVkMemoryAllocateFlagsInfo.Bufferinstance 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 newVkMemoryAllocateFlagsInfoinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkMemoryAllocateFlagsInfo callocStack()
Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkMemoryAllocateFlagsInfo mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkMemoryAllocateFlagsInfo callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkMemoryAllocateFlagsInfoinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkMemoryAllocateFlagsInfo.Buffer callocStack(int capacity)
Returns a newVkMemoryAllocateFlagsInfo.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-