Structures

VkImportMemoryMetalHandleInfoEXT

Import Metal memory created on the same physical device

To import memory from a Metal handle, add a VkImportMemoryMetalHandleInfoEXT structure to the pNext chain of the VkMemoryAllocateInfo structure.

The VkImportMemoryMetalHandleInfoEXT structure is defined as:

typedef struct VkImportMemoryMetalHandleInfoEXT {
    VkStructureType sType;
    const void* pNext;
    VkExternalMemoryHandleTypeFlagBits handleType;
    void* handle;
} VkImportMemoryMetalHandleInfoEXT;
  • sType is a VkStructureType value identifying this structure.
  • pNext is NULL or a pointer to a structure extending this structure.
  • handleType is a VkExternalMemoryHandleTypeFlagBits value specifying the type of handle or name.
  • handle is NULL or the external handle to import.

Importing memory object payloads from Metal handles shares the ownership of the handle to the Vulkan implementation.

Applications can import the same payload into multiple instances of Vulkan, into the same instance from which it was exported, and multiple times into a given Vulkan instance. In all cases, each import operation must create a distinct VkDeviceMemory object.

Valid Usage

VUID-VkImportMemoryMetalHandleInfoEXT-handleType-10408

If handleType is not 0, it must be supported for import, as reported by VkExternalImageFormatProperties or VkExternalBufferProperties

VUID-VkImportMemoryMetalHandleInfoEXT-handle-10409

The memory from which handle was exported must have been created on the same underlying physical device as device

VUID-VkImportMemoryMetalHandleInfoEXT-handleType-10410

If handleType is not 0, it must be VK_EXTERNAL_MEMORY_HANDLE_TYPE_MTLBUFFER_BIT_EXT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_MTLTEXTURE_BIT_EXT or VK_EXTERNAL_MEMORY_HANDLE_TYPE_MTLHEAP_BIT_EXT

VUID-VkImportMemoryMetalHandleInfoEXT-handleType-10411

If handleType is not 0 , handle must be a valid non-NULL handle of the type specified by handleType

Valid Usage (Implicit)

VUID-VkImportMemoryMetalHandleInfoEXT-sType-sType

sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_METAL_HANDLE_INFO_EXT