C Specification
The VkMemoryAllocateInfo
structure is defined as:
typedef struct VkMemoryAllocateInfo {
VkStructureType sType;
const void* pNext;
VkDeviceSize allocationSize;
uint32_t memoryTypeIndex;
} VkMemoryAllocateInfo;
Members
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific structure. -
allocationSize
is the size of the allocation in bytes -
memoryTypeIndex
is an index identifying a memory type from thememoryTypes
array of the VkPhysicalDeviceMemoryProperties structure
Description
An instance of the VkMemoryAllocateInfo structure defines a memory
import operation if the pNext
chain contains an instance of one of the
following structures:
-
VkImportMemoryWin32HandleInfoKHR with non-zero
handleType
value -
VkImportMemoryFdInfoKHR with a non-zero
handleType
value -
VkImportMemoryHostPointerInfoEXT with a non-zero
handleType
value -
VkImportAndroidHardwareBufferInfoANDROID with a non-
NULL
buffer
value
Importing 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.
Note
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
VK_ERROR_INVALID_EXTERNAL_HANDLE
.
See Also
VkDeviceSize
, VkStructureType, vkAllocateMemory
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.