Class VkPresentIdKHR

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

public class VkPresentIdKHR extends org.lwjgl.system.Struct<VkPresentIdKHR> implements org.lwjgl.system.NativeResource
The list of presentation identifiers.
Description

For applications to be able to reference specific presentation events queued by a call to vkQueuePresentKHR, an identifier needs to be associated with them. When the presentId feature is enabled, applications can include the VkPresentIdKHR structure in the pNext chain of the VkPresentInfoKHR structure to supply identifiers.

Each VkSwapchainKHR has a presentId associated with it. This value is initially zero when the VkSwapchainKHR is created.

When a VkPresentIdKHR structure with a non-NULL pPresentIds is included in the pNext chain of a VkPresentInfoKHR structure, each pSwapchains entry has a presentId associated in the pPresentIds array at the same index as the swapchain in the pSwapchains array. If this presentId is non-zero, then the application can later use this value to refer to that image presentation. A value of zero indicates that this presentation has no associated presentId. A non-zero presentId must be greater than any non-zero presentId passed previously by the application for the same swapchain.

There is no requirement for any precise timing relationship between the presentation of the image to the user and the update of the presentId value, but implementations should make this as close as possible to the presentation of the first pixel in the new image to the user.

Valid Usage
  • swapchainCount must be the same value as VkPresentInfoKHR::swapchainCount, where this VkPresentIdKHR is in the pNext chain of the VkPresentInfoKHR structure
  • Each presentIds entry must be greater than any previous presentIds entry passed for the associated pSwapchains entry
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_PRESENT_ID_KHR
  • If pPresentIds is not NULL, pPresentIds must be a valid pointer to an array of swapchainCount uint64_t values
  • swapchainCount must be greater than 0

Layout


 struct VkPresentIdKHR {
     VkStructureType sType();
     void const * pNext();
     uint32_t swapchainCount();
     uint64_t const * pPresentIds();
 }
  • 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.
    • SWAPCHAINCOUNT

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

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

    • VkPresentIdKHR

      public VkPresentIdKHR(ByteBuffer container)
      Creates a VkPresentIdKHR 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<VkPresentIdKHR>
    • sType

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

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

      public int swapchainCount()
      the number of swapchains being presented to the vkQueuePresentKHR command.
    • pPresentIds

      public @Nullable LongBuffer pPresentIds()
      NULL or a pointer to an array of uint64_t with swapchainCount entries. If not NULL, each non-zero value in pPresentIds specifies the present id to be associated with the presentation of the swapchain with the same index in the QueuePresentKHR call.
    • sType

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

      public VkPresentIdKHR sType$Default()
      Sets the STRUCTURE_TYPE_PRESENT_ID_KHR value to the sType() field.
    • pNext

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

      public VkPresentIdKHR swapchainCount(int value)
      Sets the specified value to the swapchainCount() field.
    • pPresentIds

      public VkPresentIdKHR pPresentIds(@Nullable LongBuffer value)
      Sets the address of the specified LongBuffer to the pPresentIds() field.
    • set

      public VkPresentIdKHR set(int sType, long pNext, int swapchainCount, @Nullable LongBuffer pPresentIds)
      Initializes this struct with the specified values.
    • set

      public VkPresentIdKHR set(VkPresentIdKHR src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static VkPresentIdKHR.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkPresentIdKHR.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().
    • nswapchainCount

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

      public static @Nullable LongBuffer npPresentIds(long struct)
      Unsafe version of pPresentIds.
    • 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.
    • nswapchainCount

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

      public static void npPresentIds(long struct, @Nullable LongBuffer value)
      Unsafe version of pPresentIds.