Class VkMemoryGetFdInfoKHR

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

    public class VkMemoryGetFdInfoKHR
    extends Struct
    implements NativeResource
    Structure describing a POSIX FD semaphore export operation.
    Description

    The properties of the file descriptor exported depend on the value of handleType. See VkExternalMemoryHandleTypeFlagBits for a description of the properties of the defined external memory handle types.

    Note

    The size of the exported file may be larger than the size requested by VkMemoryAllocateInfo::allocationSize. If handleType is EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT, then the application can query the file's actual size with link:man:lseek(2)[lseek(2)].

    Valid Usage
    • handleType must have been included in VkExportMemoryAllocateInfo::handleTypes when memory was created.
    • handleType must be defined as a POSIX file descriptor handle.
    Valid Usage (Implicit)
    • sType must be STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR
    • pNext must be NULL
    • memory must be a valid VkDeviceMemory handle
    • handleType must be a valid VkExternalMemoryHandleTypeFlagBits value
    See Also

    GetMemoryFdKHR

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • memory – the memory object from which the handle will be exported.
    • handleType – the type of handle requested.

    Layout

    
     struct VkMemoryGetFdInfoKHR {
         VkStructureType sType;
         void const * pNext;
         VkDeviceMemory memory;
         VkExternalMemoryHandleTypeFlagBits handleType;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

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

        The struct member offsets.
    • Constructor Detail

      • VkMemoryGetFdInfoKHR

        public VkMemoryGetFdInfoKHR​(java.nio.ByteBuffer container)
        Creates a VkMemoryGetFdInfoKHR 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • sType

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

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

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

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

        public VkMemoryGetFdInfoKHR sType​(int value)
        Sets the specified value to the sType field.
      • pNext

        public VkMemoryGetFdInfoKHR pNext​(long value)
        Sets the specified value to the pNext field.
      • memory

        public VkMemoryGetFdInfoKHR memory​(long value)
        Sets the specified value to the memory field.
      • handleType

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

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

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

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

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

        @Nullable
        public static VkMemoryGetFdInfoKHR createSafe​(long address)
        Like create, but returns null if address is NULL.
      • callocStack

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

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

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

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

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

        public static long nmemory​(long struct)
        Unsafe version of memory().
      • nhandleType

        public static int nhandleType​(long struct)
        Unsafe version of handleType().
      • 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.
      • nmemory

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

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