Class VkPresentInfoKHR

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkPresentInfoKHR>
org.lwjgl.vulkan.VkPresentInfoKHR
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkPresentInfoKHR extends org.lwjgl.system.Struct<VkPresentInfoKHR> implements org.lwjgl.system.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 0, and the dstStageMask parameter should be PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT.

Valid Usage
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, VkFrameBoundaryEXT, VkPresentIdKHR, VkPresentRegionsKHR, VkPresentTimesInfoGOOGLE, VkSwapchainPresentFenceInfoEXT, or VkSwapchainPresentModeInfoEXT
  • The sType value of each struct 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 of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice
See Also

QueuePresentKHR

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 Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • STYPE

      public static final int STYPE
      The struct member offsets.
    • PNEXT

      public static final int PNEXT
      The struct member offsets.
    • WAITSEMAPHORECOUNT

      public static final int WAITSEMAPHORECOUNT
      The struct member offsets.
    • PWAITSEMAPHORES

      public static final int PWAITSEMAPHORES
      The struct member offsets.
    • SWAPCHAINCOUNT

      public static final int SWAPCHAINCOUNT
      The struct member offsets.
    • PSWAPCHAINS

      public static final int PSWAPCHAINS
      The struct member offsets.
    • PIMAGEINDICES

      public static final int PIMAGEINDICES
      The struct member offsets.
    • PRESULTS

      public static final int PRESULTS
      The struct member offsets.
  • Constructor Details

    • VkPresentInfoKHR

      public VkPresentInfoKHR(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 Details

    • sizeof

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

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

      public long pNext()
      NULL or a pointer to a structure extending this structure.
    • waitSemaphoreCount

      public int waitSemaphoreCount()
      the number of semaphores to wait for before issuing the present request. The number may be zero.
    • pWaitSemaphores

      public @Nullable LongBuffer pWaitSemaphores()
      NULL or a pointer to an array of VkSemaphore objects with waitSemaphoreCount entries, and specifies the semaphores to wait for before issuing the present request.
    • swapchainCount

      public int swapchainCount()
      the number of swapchains being presented to by this command.
    • pSwapchains

      public LongBuffer pSwapchains()
      a pointer to an array of VkSwapchainKHR objects with swapchainCount entries.
    • pImageIndices

      public IntBuffer pImageIndices()
      a pointer to 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

      public @Nullable IntBuffer pResults()
      a pointer to 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.
    • sType

      public VkPresentInfoKHR sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkPresentInfoKHR sType$Default()
      Sets the STRUCTURE_TYPE_PRESENT_INFO_KHR value to the sType() field.
    • pNext

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

      Prepends the specified VkDeviceGroupPresentInfoKHR value to the pNext chain.
    • pNext

      Prepends the specified VkDisplayPresentInfoKHR value to the pNext chain.
    • pNext

      public VkPresentInfoKHR pNext(VkFrameBoundaryEXT value)
      Prepends the specified VkFrameBoundaryEXT value to the pNext chain.
    • pNext

      public VkPresentInfoKHR pNext(VkPresentIdKHR value)
      Prepends the specified VkPresentIdKHR value to the pNext chain.
    • pNext

      public VkPresentInfoKHR pNext(VkPresentRegionsKHR value)
      Prepends the specified VkPresentRegionsKHR value to the pNext chain.
    • pNext

      Prepends the specified VkPresentTimesInfoGOOGLE value to the pNext chain.
    • pNext

      Prepends the specified VkSwapchainPresentFenceInfoEXT value to the pNext chain.
    • pNext

      Prepends the specified VkSwapchainPresentModeInfoEXT value to the pNext chain.
    • pWaitSemaphores

      public VkPresentInfoKHR pWaitSemaphores(@Nullable 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(LongBuffer value)
      Sets the address of the specified LongBuffer to the pSwapchains() field.
    • pImageIndices

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

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

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

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

      public static VkPresentInfoKHR.Buffer malloc(int capacity)
      Returns a new VkPresentInfoKHR.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkPresentInfoKHR.Buffer calloc(int capacity)
      Returns a new VkPresentInfoKHR.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkPresentInfoKHR.Buffer create(int capacity)
      Returns a new VkPresentInfoKHR.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkPresentInfoKHR.Buffer create(long address, int capacity)
      Create a VkPresentInfoKHR.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

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

      @Deprecated public static VkPresentInfoKHR mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkPresentInfoKHR callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkPresentInfoKHR mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkPresentInfoKHR callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkPresentInfoKHR.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkPresentInfoKHR.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkPresentInfoKHR.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkPresentInfoKHR.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static VkPresentInfoKHR malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkPresentInfoKHR instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

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

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

      public static VkPresentInfoKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkPresentInfoKHR.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      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().
    • nwaitSemaphoreCount

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

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

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

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

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

      public static @Nullable 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 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, LongBuffer value)
      Unsafe version of pSwapchains.
    • npImageIndices

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

      public static void npResults(long struct, @Nullable 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