Class KHRExternalMemoryFd


  • public class KHRExternalMemoryFd
    extends java.lang.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
    Contact
    Last Modified Date
    2016-10-21
    IP Status
    No known IP claims.
    Contributors
    • James Jones, NVIDIA
    • Jeff Juliano, NVIDIA
    • Method Detail

      • nvkGetMemoryFdKHR

        public static int nvkGetMemoryFdKHR​(VkDevice device,
                                            long pGetFdInfo,
                                            long pFd)
        Unsafe version of: GetMemoryFdKHR
      • vkGetMemoryFdKHR

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

        To export a POSIX file descriptor representing the underlying resources of a Vulkan device memory object, call:

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

        Each call to GetMemoryFdKHR must create a new file descriptor and transfer ownership of it 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 a 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 an instance of the VkMemoryGetFdInfoKHR structure containing parameters of the export operation.
        pFd - will return a file descriptor representing the underlying resources of the device memory object.
      • nvkGetMemoryFdPropertiesKHR

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

        public static int vkGetMemoryFdPropertiesKHR​(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 - the type of the handle fd.
        fd - the handle which will be imported.
        pMemoryFdProperties - will return properties of the handle fd.