# VkImportMemoryMetalHandleInfoEXT(3) Manual Page

## Name

VkImportMemoryMetalHandleInfoEXT - Import Metal memory created on the same physical device

Loading… please wait.

## C Specification

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:

    // Provided by VK_EXT_external_memory_metal
    typedef struct VkImportMemoryMetalHandleInfoEXT {
        VkStructureType                       sType;
        const void*                           pNext;
        VkExternalMemoryHandleTypeFlagBits    handleType;
        void*                                 handle;
    } VkImportMemoryMetalHandleInfoEXT;

## Members

- `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.

## Description

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`

- VUID-VkImportMemoryMetalHandleInfoEXT-handle-10412
  `handle` must obey any requirements listed for `handleType` in external memory handle types compatibility

Valid Usage (Implicit)

- VUID-VkImportMemoryMetalHandleInfoEXT-sType-sType
  `sType` must be `VK_STRUCTURE_TYPE_IMPORT_MEMORY_METAL_HANDLE_INFO_EXT`

- VUID-VkImportMemoryMetalHandleInfoEXT-handleType-parameter
  If `handleType` is not `0`, `handleType` must be a valid VkExternalMemoryHandleTypeFlagBits value

## See Also

VK_EXT_external_memory_metal, VkExternalMemoryHandleTypeFlagBits, VkStructureType

## 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 2014-2025 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0