C Specification

To export a Metal handle representing the payload of a Vulkan device memory object, call:

// Provided by VK_EXT_external_memory_metal
VkResult vkGetMemoryMetalHandleEXT(
    VkDevice                                    device,
    const VkMemoryGetMetalHandleInfoEXT*        pGetMetalHandleInfo,
    void**                                      pHandle);

Parameters

  • device is the logical device that created the device memory being exported.

  • pGetMetalHandleInfo is a pointer to a VkMemoryGetMetalHandleInfoEXT structure containing parameters of the export operation.

  • pHandle will return the Metal handle representing the payload of the device memory object.

Description

Unless the app retains the handle object returned by the call, the lifespan will be the same as the associated VkDeviceMemory.

Valid Usage (Implicit)
  • VUID-vkGetMemoryMetalHandleEXT-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkGetMemoryMetalHandleEXT-pGetMetalHandleInfo-parameter
    pGetMetalHandleInfo must be a valid pointer to a valid VkMemoryGetMetalHandleInfoEXT structure

  • VUID-vkGetMemoryMetalHandleEXT-pHandle-parameter
    pHandle must be a valid pointer to a pointer value

Return Codes
On success, this command returns
  • VK_SUCCESS

On failure, this command returns
  • VK_ERROR_TOO_MANY_OBJECTS

  • VK_ERROR_OUT_OF_HOST_MEMORY

See Also

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

SPDX-License-Identifier: CC-BY-4.0