Class KHRExternalMemoryFd

java.lang.Object
org.lwjgl.vulkan.KHRExternalMemoryFd

public class KHRExternalMemoryFd extends Object
An application may wish to reference device memory in multiple Vulkan logical devices or instances, in multiple processes, and/or in multiple APIs. This extension enables an application to export POSIX file descriptor handles from Vulkan memory objects and to import Vulkan memory objects from POSIX file descriptor handles exported from other Vulkan memory objects or from similar resources in other APIs.
Name String
VK_KHR_external_memory_fd
Extension Type
Device extension
Registered Extension Number
75
Revision
1
Extension and Version Dependencies
VK_KHR_external_memory or Version 1.1
Contact
Other Extension Metadata
Last Modified Date
2016-10-21
IP Status
No known IP claims.
Contributors
  • James Jones, NVIDIA
  • Jeff Juliano, NVIDIA
  • Field Details

  • Method Details

    • nvkGetMemoryFdKHR

      public static int nvkGetMemoryFdKHR(org.lwjgl.vulkan.VkDevice device, long pGetFdInfo, long pFd)
      Unsafe version of: GetMemoryFdKHR
    • vkGetMemoryFdKHR

      public static int vkGetMemoryFdKHR(org.lwjgl.vulkan.VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, IntBuffer pFd)
      Get a POSIX file descriptor for a memory object.
      C Specification

      To export a POSIX file descriptor referencing the payload of a Vulkan device memory object, call:

      
       VkResult vkGetMemoryFdKHR(
           VkDevice                                    device,
           const VkMemoryGetFdInfoKHR*                 pGetFdInfo,
           int*                                        pFd);
      Description

      Each call to vkGetMemoryFdKHR must create a new file descriptor holding a reference to the memory object’s payload and transfer ownership of the file descriptor to the application. To avoid leaking resources, the application must release ownership of the file descriptor using the close system call when it is no longer needed, or by importing a Vulkan memory object from it. Where supported by the operating system, the implementation must set the file descriptor to be closed automatically when an execve system call is made.

      Valid Usage (Implicit)
      • device must be a valid VkDevice handle
      • pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure
      • pFd must be a valid pointer to an int value
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkMemoryGetFdInfoKHR

      Parameters:
      device - the logical device that created the device memory being exported.
      pGetFdInfo - a pointer to a VkMemoryGetFdInfoKHR structure containing parameters of the export operation.
      pFd - will return a file descriptor referencing the payload of the device memory object.
    • nvkGetMemoryFdPropertiesKHR

      public static int nvkGetMemoryFdPropertiesKHR(org.lwjgl.vulkan.VkDevice device, int handleType, int fd, long pMemoryFdProperties)
      Unsafe version of: GetMemoryFdPropertiesKHR
    • vkGetMemoryFdPropertiesKHR

      public static int vkGetMemoryFdPropertiesKHR(org.lwjgl.vulkan.VkDevice device, int handleType, int fd, VkMemoryFdPropertiesKHR pMemoryFdProperties)
      Get Properties of External Memory File Descriptors.
      C Specification

      POSIX file descriptor memory handles compatible with Vulkan may also be created by non-Vulkan APIs using methods beyond the scope of this specification. To determine the correct parameters to use when importing such handles, call:

      
       VkResult vkGetMemoryFdPropertiesKHR(
           VkDevice                                    device,
           VkExternalMemoryHandleTypeFlagBits          handleType,
           int                                         fd,
           VkMemoryFdPropertiesKHR*                    pMemoryFdProperties);
      Valid Usage
      Valid Usage (Implicit)
      • device must be a valid VkDevice handle
      • handleType must be a valid VkExternalMemoryHandleTypeFlagBits value
      • pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure
      Return Codes
      On success, this command returns
      On failure, this command returns
      See Also

      VkMemoryFdPropertiesKHR

      Parameters:
      device - the logical device that will be importing fd.
      handleType - a VkExternalMemoryHandleTypeFlagBits value specifying the type of the handle fd.
      fd - the handle which will be imported.
      pMemoryFdProperties - a pointer to a VkMemoryFdPropertiesKHR structure in which the properties of the handle fd are returned.
    • vkGetMemoryFdKHR

      public static int vkGetMemoryFdKHR(org.lwjgl.vulkan.VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)
      Array version of: GetMemoryFdKHR