Class VkPastPresentationTimingGOOGLE

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

    public class VkPastPresentationTimingGOOGLE
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure containing timing information about a previously-presented image.
    Description

    The results for a given swapchain and presentID are only returned once from vkGetPastPresentationTimingGOOGLE.

    The application can use the VkPastPresentationTimingGOOGLE values to occasionally adjust its timing. For example, if actualPresentTime is later than expected (e.g. one refreshDuration late), the application may increase its target IPD to a higher multiple of refreshDuration (e.g. decrease its frame rate from 60Hz to 30Hz). If actualPresentTime and earliestPresentTime are consistently different, and if presentMargin is consistently large enough, the application may decrease its target IPD to a smaller multiple of refreshDuration (e.g. increase its frame rate from 30Hz to 60Hz). If actualPresentTime and earliestPresentTime are same, and if presentMargin is consistently high, the application may delay the start of its input-render-present loop in order to decrease the latency between user input and the corresponding present (always leaving some margin in case a new image takes longer to render than the previous image). An application that desires its target IPD to always be the same as refreshDuration, can also adjust features until actualPresentTime is never late and presentMargin is satisfactory.

    See Also

    GetPastPresentationTimingGOOGLE

    Member documentation

    • presentID – an application-provided value that was given to a previous vkQueuePresentKHR command via VkPresentTimeGOOGLE::presentID (see below). It can be used to uniquely identify a previous present with the QueuePresentKHR command.
    • desiredPresentTime – an application-provided value that was given to a previous QueuePresentKHR command via VkPresentTimeGOOGLE::desiredPresentTime. If non-zero, it was used by the application to indicate that an image not be presented any sooner than desiredPresentTime.
    • actualPresentTime – the time when the image of the swapchain was actually displayed.
    • earliestPresentTime – the time when the image of the swapchain could have been displayed. This may differ from actualPresentTime if the application requested that the image be presented no sooner than VkPresentTimeGOOGLE::desiredPresentTime.
    • presentMargin – an indication of how early the vkQueuePresentKHR command was processed compared to how soon it needed to be processed, and still be presented at earliestPresentTime.

    Layout

    
     struct VkPastPresentationTimingGOOGLE {
         uint32_t presentID;
         uint64_t desiredPresentTime;
         uint64_t actualPresentTime;
         uint64_t earliestPresentTime;
         uint64_t presentMargin;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • PRESENTID, DESIREDPRESENTTIME, ACTUALPRESENTTIME, EARLIESTPRESENTTIME, PRESENTMARGIN

        The struct member offsets.
    • Constructor Detail

      • VkPastPresentationTimingGOOGLE

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

        public int presentID()
        Returns the value of the presentID field.
      • desiredPresentTime

        public long desiredPresentTime()
        Returns the value of the desiredPresentTime field.
      • actualPresentTime

        public long actualPresentTime()
        Returns the value of the actualPresentTime field.
      • earliestPresentTime

        public long earliestPresentTime()
        Returns the value of the earliestPresentTime field.
      • presentMargin

        public long presentMargin()
        Returns the value of the presentMargin field.
      • malloc

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

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

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

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

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

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

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

        public static int npresentID​(long struct)
        Unsafe version of presentID().
      • ndesiredPresentTime

        public static long ndesiredPresentTime​(long struct)
        Unsafe version of desiredPresentTime().
      • nactualPresentTime

        public static long nactualPresentTime​(long struct)
        Unsafe version of actualPresentTime().
      • nearliestPresentTime

        public static long nearliestPresentTime​(long struct)
        Unsafe version of earliestPresentTime().
      • npresentMargin

        public static long npresentMargin​(long struct)
        Unsafe version of presentMargin().