Class VkPresentInfoKHR

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

    public class VkPresentInfoKHR
    extends Struct
    implements NativeResource
    Structure describing parameters of a queue presentation.
    Description

    Before an application can present an image, the image's layout must be transitioned to the IMAGE_LAYOUT_PRESENT_SRC_KHR layout, or for a shared presentable image the IMAGE_LAYOUT_SHARED_PRESENT_KHR layout.

    Note

    When transitioning the image to IMAGE_LAYOUT_SHARED_PRESENT_KHR or IMAGE_LAYOUT_PRESENT_SRC_KHR, there is no need to delay subsequent processing, or perform any visibility operations (as QueuePresentKHR performs automatic visibility operations). To achieve this, the dstAccessMask member of the VkImageMemoryBarrier should be set to 0, and the dstStageMask parameter should be set to PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT.

    Valid Usage
    • Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the IMAGE_LAYOUT_PRESENT_SRC_KHR or IMAGE_LAYOUT_SHARED_PRESENT_KHR layout at the time the operation is executed on a VkDevice
    Valid Usage (Implicit)
    • sType must be STRUCTURE_TYPE_PRESENT_INFO_KHR
    • Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkDeviceGroupPresentInfoKHR, VkDisplayPresentInfoKHR, VkPresentRegionsKHR, or VkPresentTimesInfoGOOGLE
    • Each sType member in the pNext chain must be unique
    • If waitSemaphoreCount is not 0, pWaitSemaphores must be a valid pointer to an array of waitSemaphoreCount valid VkSemaphore handles
    • pSwapchains must be a valid pointer to an array of swapchainCount valid VkSwapchainKHR handles
    • pImageIndices must be a valid pointer to an array of swapchainCount uint32_t values
    • If pResults is not NULL, pResults must be a valid pointer to an array of swapchainCount VkResult values
    • swapchainCount must be greater than 0
    • Both of the elements of pSwapchains, and the elements of pWaitSemaphores that are valid handles must have been created, allocated, or retrieved from the same VkInstance
    See Also

    QueuePresentKHR

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • waitSemaphoreCount – the number of semaphores to wait for before issuing the present request. The number may be zero.
    • pWaitSemaphores – if not NULL, is an array of VkSemaphore objects with waitSemaphoreCount entries, and specifies the semaphores to wait for before issuing the present request.
    • swapchainCount – the number of swapchains being presented to by this command.
    • pSwapchains – an array of VkSwapchainKHR objects with swapchainCount entries. A given swapchain must not appear in this list more than once.
    • pImageIndices – an array of indices into the array of each swapchain’s presentable images, with swapchainCount entries. Each entry in this array identifies the image to present on the corresponding entry in the pSwapchains array.
    • pResults – an array of VkResult typed elements with swapchainCount entries. Applications that do not need per-swapchain results can use NULL for pResults. If non-NULL, each entry in pResults will be set to the VkResult for presenting the swapchain corresponding to the same index in pSwapchains.

    Layout

    
     struct VkPresentInfoKHR {
         VkStructureType sType;
         void const * pNext;
         uint32_t waitSemaphoreCount;
         VkSemaphore const * pWaitSemaphores;
         uint32_t swapchainCount;
         VkSwapchainKHR const * pSwapchains;
         uint32_t const * pImageIndices;
         VkResult * pResults;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, WAITSEMAPHORECOUNT, PWAITSEMAPHORES, SWAPCHAINCOUNT, PSWAPCHAINS, PIMAGEINDICES, PRESULTS

        The struct member offsets.
    • Constructor Detail

      • VkPresentInfoKHR

        public VkPresentInfoKHR​(java.nio.ByteBuffer container)
        Creates a VkPresentInfoKHR 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.
      • waitSemaphoreCount

        public int waitSemaphoreCount()
        Returns the value of the waitSemaphoreCount field.
      • pWaitSemaphores

        @Nullable
        public java.nio.LongBuffer pWaitSemaphores()
        Returns a LongBuffer view of the data pointed to by the pWaitSemaphores field.
      • swapchainCount

        public int swapchainCount()
        Returns the value of the swapchainCount field.
      • pSwapchains

        public java.nio.LongBuffer pSwapchains()
        Returns a LongBuffer view of the data pointed to by the pSwapchains field.
      • pImageIndices

        public java.nio.IntBuffer pImageIndices()
        Returns a IntBuffer view of the data pointed to by the pImageIndices field.
      • pResults

        @Nullable
        public java.nio.IntBuffer pResults()
        Returns a IntBuffer view of the data pointed to by the pResults field.
      • sType

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

        public VkPresentInfoKHR pNext​(long value)
        Sets the specified value to the pNext field.
      • pWaitSemaphores

        public VkPresentInfoKHR pWaitSemaphores​(@Nullable
                                                java.nio.LongBuffer value)
        Sets the address of the specified LongBuffer to the pWaitSemaphores field.
      • swapchainCount

        public VkPresentInfoKHR swapchainCount​(int value)
        Sets the specified value to the swapchainCount field.
      • pSwapchains

        public VkPresentInfoKHR pSwapchains​(java.nio.LongBuffer value)
        Sets the address of the specified LongBuffer to the pSwapchains field.
      • pImageIndices

        public VkPresentInfoKHR pImageIndices​(java.nio.IntBuffer value)
        Sets the address of the specified IntBuffer to the pImageIndices field.
      • pResults

        public VkPresentInfoKHR pResults​(@Nullable
                                         java.nio.IntBuffer value)
        Sets the address of the specified IntBuffer to the pResults field.
      • set

        public VkPresentInfoKHR set​(int sType,
                                    long pNext,
                                    @Nullable
                                    java.nio.LongBuffer pWaitSemaphores,
                                    int swapchainCount,
                                    java.nio.LongBuffer pSwapchains,
                                    java.nio.IntBuffer pImageIndices,
                                    @Nullable
                                    java.nio.IntBuffer pResults)
        Initializes this struct with the specified values.
      • set

        public VkPresentInfoKHR set​(VkPresentInfoKHR src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • createSafe

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

        @Nullable
        public static VkPresentInfoKHR.Buffer createSafe​(long address,
                                                         int capacity)
        Like create, but returns null if address is NULL.
      • nsType

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

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

        public static int nwaitSemaphoreCount​(long struct)
        Unsafe version of waitSemaphoreCount().
      • npWaitSemaphores

        @Nullable
        public static java.nio.LongBuffer npWaitSemaphores​(long struct)
        Unsafe version of pWaitSemaphores.
      • nswapchainCount

        public static int nswapchainCount​(long struct)
        Unsafe version of swapchainCount().
      • npSwapchains

        public static java.nio.LongBuffer npSwapchains​(long struct)
        Unsafe version of pSwapchains.
      • npImageIndices

        public static java.nio.IntBuffer npImageIndices​(long struct)
        Unsafe version of pImageIndices.
      • npResults

        @Nullable
        public static java.nio.IntBuffer npResults​(long struct)
        Unsafe version of pResults.
      • 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.
      • nwaitSemaphoreCount

        public static void nwaitSemaphoreCount​(long struct,
                                               int value)
        Sets the specified value to the waitSemaphoreCount field of the specified struct.
      • npWaitSemaphores

        public static void npWaitSemaphores​(long struct,
                                            @Nullable
                                            java.nio.LongBuffer value)
        Unsafe version of pWaitSemaphores.
      • nswapchainCount

        public static void nswapchainCount​(long struct,
                                           int value)
        Sets the specified value to the swapchainCount field of the specified struct.
      • npSwapchains

        public static void npSwapchains​(long struct,
                                        java.nio.LongBuffer value)
        Unsafe version of pSwapchains.
      • npImageIndices

        public static void npImageIndices​(long struct,
                                          java.nio.IntBuffer value)
        Unsafe version of pImageIndices.
      • npResults

        public static void npResults​(long struct,
                                     @Nullable
                                     java.nio.IntBuffer value)
        Unsafe version of pResults.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array