public class VkMemoryAllocateInfo
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
A VkMemoryAllocateInfo structure defines a memory import operation if its pNext chain includes one of the following structures:
VkImportMemoryWin32HandleInfoKHR with non-zero handleType valueVkImportMemoryFdInfoKHR with a non-zero handleType valueVkImportMemoryHostPointerInfoEXT with a non-zero handleType valueImporting memory must not modify the content of the memory. Implementations must ensure that importing memory does not enable the importing Vulkan instance to access any memory or resources in other Vulkan instances other than that corresponding to the memory object imported. Implementations must also ensure accessing imported memory which has not been initialized does not allow the importing Vulkan instance to obtain data from the exporting Vulkan instance or vice-versa.
How exported and imported memory is isolated is left to the implementation, but applications should be aware that such isolation may prevent implementations from placing multiple exportable memory objects in the same physical or virtual page. Hence, applications should avoid creating many small external memory objects whenever possible.
When performing a memory import operation, it is the responsibility of the application to ensure the external handles meet all valid usage requirements. However, implementations must perform sufficient validation of external handles to ensure that the operation results in a valid memory object which will not cause program termination, device loss, queue stalls, or corruption of other resources when used as allowed according to its allocation parameters. If the external handle provided does not meet these requirements, the implementation must fail the memory import operation with the error code ERROR_INVALID_EXTERNAL_HANDLE.
allocationSize must be greater than 0pNext chain includes a VkExportMemoryAllocateInfo structure, and any of the handle types specified in VkExportMemoryAllocateInfo::handleTypes require a dedicated allocation, as reported by GetPhysicalDeviceImageFormatProperties2 in VkExternalImageFormatProperties::externalMemoryProperties.externalMemoryFeatures or VkExternalBufferProperties::externalMemoryProperties.externalMemoryFeatures, the pNext chain must include a VkMemoryDedicatedAllocateInfo or VkDedicatedAllocationMemoryAllocateInfoNV structure with either its image or buffer member set to a value other than NULL_HANDLE.pNext chain includes a VkExportMemoryAllocateInfo structure, it must not include a VkExportMemoryAllocateInfoNV or VkExportMemoryWin32HandleInfoNV structure.pNext chain includes a VkImportMemoryWin32HandleInfoKHR structure, it must not include a VkImportMemoryWin32HandleInfoNV structure.EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, then the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created.VkMemoryAllocateFlagsInfo must match that specified when the memory object being imported was allocated.AllocateMemory must match the list of physical devices that comprise the logical device on which the memory was originally allocated.memoryTypeIndex must be one of those returned by GetMemoryWin32HandlePropertiesKHR.EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR or EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR, then the values of allocationSize and memoryTypeIndex must match those specified when the memory object being imported was created.EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT, or EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, allocationSize must match the size reported in the memory requirements of the image or buffer member of the VkDedicatedAllocationMemoryAllocateInfoNV structure included in the pNext chain.EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, allocationSize must match the size specified when creating the Direct3D 12 heap from which the external handle was extracted.memoryTypeIndex must be one of those returned by GetMemoryFdPropertiesKHR.VkMemoryAllocateInfo::memoryTypeIndex must not indicate a memory type that reports MEMORY_PROPERTY_PROTECTED_BIT.memoryTypeIndex must be one of those returned by GetMemoryHostPointerPropertiesEXTallocationSize must be an integer multiple of VkPhysicalDeviceExternalMemoryHostPropertiesEXT::minImportedHostPointerAlignmentpNext chain must not include a VkDedicatedAllocationMemoryAllocateInfoNV structure with either its image or buffer field set to a value other than NULL_HANDLE.pNext chain must not include a VkMemoryDedicatedAllocateInfo structure with either its image or buffer field set to a value other than NULL_HANDLE.VkMemoryOpaqueCaptureAddressAllocateInfoKHR::opaqueCaptureAddress is not zero, VkMemoryAllocateFlagsInfo::flags must include MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHRVkMemoryAllocateFlagsInfo::flags includes MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR, the bufferDeviceAddressCaptureReplay feature must be enabledVkMemoryAllocateFlagsInfo::flags includes MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT_KHR, the bufferDeviceAddress feature must be enabledpNext chain includes a VkImportMemoryHostPointerInfoEXT structure, VkMemoryOpaqueCaptureAddressAllocateInfoKHR::opaqueCaptureAddress must be zeroVkMemoryOpaqueCaptureAddressAllocateInfoKHR::opaqueCaptureAddress must be zerosType must be STRUCTURE_TYPE_MEMORY_ALLOCATE_INFOpNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDedicatedAllocationMemoryAllocateInfoNV, VkExportMemoryAllocateInfo, VkExportMemoryAllocateInfoNV, VkExportMemoryWin32HandleInfoKHR, VkExportMemoryWin32HandleInfoNV, VkImportMemoryFdInfoKHR, VkImportMemoryHostPointerInfoEXT, VkImportMemoryWin32HandleInfoKHR, VkImportMemoryWin32HandleInfoNV, VkMemoryAllocateFlagsInfo, VkMemoryDedicatedAllocateInfo, VkMemoryOpaqueCaptureAddressAllocateInfoKHR, or VkMemoryPriorityAllocateInfoEXTsType member in the pNext chain must be uniquesType – the type of this structure.pNext – NULL or a pointer to an extension-specific structure.allocationSize – the size of the allocation in bytesmemoryTypeIndex – an index identifying a memory type from the memoryTypes array of the VkPhysicalDeviceMemoryProperties structure
struct VkMemoryAllocateInfo {
VkStructureType sType;
void const * pNext;
VkDeviceSize allocationSize;
uint32_t memoryTypeIndex;
}| Modifier and Type | Class and Description |
|---|---|
static class |
VkMemoryAllocateInfo.Buffer
An array of
VkMemoryAllocateInfo structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
ALLOCATIONSIZE
The struct member offsets.
|
static int |
MEMORYTYPEINDEX
The struct member offsets.
|
static int |
PNEXT
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
STYPE
The struct member offsets.
|
| Constructor and Description |
|---|
VkMemoryAllocateInfo(java.nio.ByteBuffer container)
Creates a
VkMemoryAllocateInfo instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
long |
allocationSize()
Returns the value of the
allocationSize field. |
VkMemoryAllocateInfo |
allocationSize(long value)
Sets the specified value to the
allocationSize field. |
static VkMemoryAllocateInfo |
calloc()
Returns a new
VkMemoryAllocateInfo instance allocated with memCalloc. |
static VkMemoryAllocateInfo.Buffer |
calloc(int capacity)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated with memCalloc. |
static VkMemoryAllocateInfo |
callocStack()
Returns a new
VkMemoryAllocateInfo instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkMemoryAllocateInfo.Buffer |
callocStack(int capacity)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static VkMemoryAllocateInfo.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkMemoryAllocateInfo |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkMemoryAllocateInfo instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static VkMemoryAllocateInfo |
create()
Returns a new
VkMemoryAllocateInfo instance allocated with BufferUtils. |
static VkMemoryAllocateInfo.Buffer |
create(int capacity)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated with BufferUtils. |
static VkMemoryAllocateInfo |
create(long address)
Returns a new
VkMemoryAllocateInfo instance for the specified memory address. |
static VkMemoryAllocateInfo.Buffer |
create(long address,
int capacity)
Create a
VkMemoryAllocateInfo.Buffer instance at the specified memory. |
static VkMemoryAllocateInfo |
createSafe(long address)
|
static VkMemoryAllocateInfo.Buffer |
createSafe(long address,
int capacity)
|
static VkMemoryAllocateInfo |
malloc()
Returns a new
VkMemoryAllocateInfo instance allocated with memAlloc. |
static VkMemoryAllocateInfo.Buffer |
malloc(int capacity)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated with memAlloc. |
static VkMemoryAllocateInfo |
mallocStack()
Returns a new
VkMemoryAllocateInfo instance allocated on the thread-local MemoryStack. |
static VkMemoryAllocateInfo.Buffer |
mallocStack(int capacity)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated on the thread-local MemoryStack. |
static VkMemoryAllocateInfo.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
VkMemoryAllocateInfo.Buffer instance allocated on the specified MemoryStack. |
static VkMemoryAllocateInfo |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
VkMemoryAllocateInfo instance allocated on the specified MemoryStack. |
int |
memoryTypeIndex()
Returns the value of the
memoryTypeIndex field. |
VkMemoryAllocateInfo |
memoryTypeIndex(int value)
Sets the specified value to the
memoryTypeIndex field. |
static long |
nallocationSize(long struct)
Unsafe version of
allocationSize(). |
static void |
nallocationSize(long struct,
long value)
Unsafe version of
allocationSize. |
static int |
nmemoryTypeIndex(long struct)
Unsafe version of
memoryTypeIndex(). |
static void |
nmemoryTypeIndex(long struct,
int value)
Unsafe version of
memoryTypeIndex. |
static long |
npNext(long struct)
Unsafe version of
pNext(). |
static void |
npNext(long struct,
long value)
Unsafe version of
pNext. |
static int |
nsType(long struct)
Unsafe version of
sType(). |
static void |
nsType(long struct,
int value)
Unsafe version of
sType. |
long |
pNext()
Returns the value of the
pNext field. |
VkMemoryAllocateInfo |
pNext(long value)
Sets the specified value to the
pNext field. |
VkMemoryAllocateInfo |
set(int sType,
long pNext,
long allocationSize,
int memoryTypeIndex)
Initializes this struct with the specified values.
|
VkMemoryAllocateInfo |
set(VkMemoryAllocateInfo src)
Copies the specified struct data to this struct.
|
int |
sizeof() |
int |
sType()
Returns the value of the
sType field. |
VkMemoryAllocateInfo |
sType(int value)
Sets the specified value to the
sType field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int STYPE
public static final int PNEXT
public static final int ALLOCATIONSIZE
public static final int MEMORYTYPEINDEX
public VkMemoryAllocateInfo(java.nio.ByteBuffer container)
VkMemoryAllocateInfo instance at the current position of the specified ByteBuffer 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic int sType()
sType field.public long pNext()
pNext field.public long allocationSize()
allocationSize field.public int memoryTypeIndex()
memoryTypeIndex field.public VkMemoryAllocateInfo sType(int value)
sType field.public VkMemoryAllocateInfo pNext(long value)
pNext field.public VkMemoryAllocateInfo allocationSize(long value)
allocationSize field.public VkMemoryAllocateInfo memoryTypeIndex(int value)
memoryTypeIndex field.public VkMemoryAllocateInfo set(int sType, long pNext, long allocationSize, int memoryTypeIndex)
public VkMemoryAllocateInfo set(VkMemoryAllocateInfo src)
src - the source structpublic static VkMemoryAllocateInfo malloc()
VkMemoryAllocateInfo instance allocated with memAlloc. The instance must be explicitly freed.public static VkMemoryAllocateInfo calloc()
VkMemoryAllocateInfo instance allocated with memCalloc. The instance must be explicitly freed.public static VkMemoryAllocateInfo create()
VkMemoryAllocateInfo instance allocated with BufferUtils.public static VkMemoryAllocateInfo create(long address)
VkMemoryAllocateInfo instance for the specified memory address.@Nullable public static VkMemoryAllocateInfo createSafe(long address)
public static VkMemoryAllocateInfo.Buffer malloc(int capacity)
VkMemoryAllocateInfo.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkMemoryAllocateInfo.Buffer calloc(int capacity)
VkMemoryAllocateInfo.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static VkMemoryAllocateInfo.Buffer create(int capacity)
VkMemoryAllocateInfo.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static VkMemoryAllocateInfo.Buffer create(long address, int capacity)
VkMemoryAllocateInfo.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static VkMemoryAllocateInfo.Buffer createSafe(long address, int capacity)
public static VkMemoryAllocateInfo mallocStack()
VkMemoryAllocateInfo instance allocated on the thread-local MemoryStack.public static VkMemoryAllocateInfo callocStack()
VkMemoryAllocateInfo instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static VkMemoryAllocateInfo mallocStack(org.lwjgl.system.MemoryStack stack)
VkMemoryAllocateInfo instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static VkMemoryAllocateInfo callocStack(org.lwjgl.system.MemoryStack stack)
VkMemoryAllocateInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static VkMemoryAllocateInfo.Buffer mallocStack(int capacity)
VkMemoryAllocateInfo.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static VkMemoryAllocateInfo.Buffer callocStack(int capacity)
VkMemoryAllocateInfo.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static VkMemoryAllocateInfo.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkMemoryAllocateInfo.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static VkMemoryAllocateInfo.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
VkMemoryAllocateInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static int nsType(long struct)
sType().public static long npNext(long struct)
pNext().public static long nallocationSize(long struct)
allocationSize().public static int nmemoryTypeIndex(long struct)
memoryTypeIndex().public static void nsType(long struct,
int value)
sType.public static void npNext(long struct,
long value)
pNext.public static void nallocationSize(long struct,
long value)
allocationSize.public static void nmemoryTypeIndex(long struct,
int value)
memoryTypeIndex.Copyright LWJGL. All Rights Reserved. License terms.