Class VkImportMemoryFdInfoKHR

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class VkImportMemoryFdInfoKHR
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    import memory created on the same physical device from a file descriptor.
    Description

    Importing memory from a file descriptor transfers ownership of the file descriptor from the application to the Vulkan implementation. The application must not perform any operations on the file descriptor after a successful import.

    Applications can import the same underlying memory 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
    Valid Usage (Implicit)

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • handleType – specifies the handle type of fd.
    • fd – the external handle to import.

    Layout

    
     struct VkImportMemoryFdInfoKHR {
         VkStructureType sType;
         void const * pNext;
         VkExternalMemoryHandleTypeFlagBits handleType;
         int fd;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, HANDLETYPE, FD

        The struct member offsets.
    • Constructor Detail

      • VkImportMemoryFdInfoKHR

        public VkImportMemoryFdInfoKHR​(java.nio.ByteBuffer container)
        Creates a VkImportMemoryFdInfoKHR instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • sType

        public int sType()
        Returns the value of the sType field.
      • pNext

        public long pNext()
        Returns the value of the pNext field.
      • handleType

        public int handleType()
        Returns the value of the handleType field.
      • fd

        public int fd()
        Returns the value of the fd field.
      • handleType

        public VkImportMemoryFdInfoKHR handleType​(int value)
        Sets the specified value to the handleType field.
      • set

        public VkImportMemoryFdInfoKHR set​(int sType,
                                           long pNext,
                                           int handleType,
                                           int fd)
        Initializes this struct with the specified values.
      • malloc

        public static VkImportMemoryFdInfoKHR malloc()
        Returns a new VkImportMemoryFdInfoKHR instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VkImportMemoryFdInfoKHR calloc()
        Returns a new VkImportMemoryFdInfoKHR instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VkImportMemoryFdInfoKHR create()
        Returns a new VkImportMemoryFdInfoKHR instance allocated with BufferUtils.
      • create

        public static VkImportMemoryFdInfoKHR create​(long address)
        Returns a new VkImportMemoryFdInfoKHR instance for the specified memory address.
      • mallocStack

        public static VkImportMemoryFdInfoKHR mallocStack()
        Returns a new VkImportMemoryFdInfoKHR instance allocated on the thread-local MemoryStack.
      • callocStack

        public static VkImportMemoryFdInfoKHR callocStack()
        Returns a new VkImportMemoryFdInfoKHR instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static VkImportMemoryFdInfoKHR mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkImportMemoryFdInfoKHR instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkImportMemoryFdInfoKHR callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkImportMemoryFdInfoKHR instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static VkImportMemoryFdInfoKHR.Buffer mallocStack​(int capacity,
                                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new VkImportMemoryFdInfoKHR.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static VkImportMemoryFdInfoKHR.Buffer callocStack​(int capacity,
                                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new VkImportMemoryFdInfoKHR.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nsType

        public static int nsType​(long struct)
        Unsafe version of sType().
      • npNext

        public static long npNext​(long struct)
        Unsafe version of pNext().
      • nhandleType

        public static int nhandleType​(long struct)
        Unsafe version of handleType().
      • nfd

        public static int nfd​(long struct)
        Unsafe version of fd().
      • nsType

        public static void nsType​(long struct,
                                  int value)
        Unsafe version of sType.
      • npNext

        public static void npNext​(long struct,
                                  long value)
        Unsafe version of pNext.
      • nhandleType

        public static void nhandleType​(long struct,
                                       int value)
        Unsafe version of handleType.
      • nfd

        public static void nfd​(long struct,
                               int value)
        Unsafe version of fd.