Class VkPastPresentationTimingGOOGLE
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.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.NativeResourceStructure containing timing information about a previously-presented image.Description
The results for a given
swapchainandpresentIDare only returned once fromvkGetPastPresentationTimingGOOGLE.The application can use the
VkPastPresentationTimingGOOGLEvalues to occasionally adjust its timing. For example, ifactualPresentTimeis later than expected (e.g. onerefreshDurationlate), the application may increase its target IPD to a higher multiple ofrefreshDuration(e.g. decrease its frame rate from 60Hz to 30Hz). IfactualPresentTimeandearliestPresentTimeare consistently different, and ifpresentMarginis consistently large enough, the application may decrease its target IPD to a smaller multiple ofrefreshDuration(e.g. increase its frame rate from 30Hz to 60Hz). IfactualPresentTimeandearliestPresentTimeare same, and ifpresentMarginis 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 asrefreshDuration, can also adjust features untilactualPresentTimeis never late andpresentMarginis satisfactory.See Also
GetPastPresentationTimingGOOGLEMember documentation
presentID– an application-provided value that was given to a previousvkQueuePresentKHRcommand viaVkPresentTimeGOOGLE::presentID(see below). It can be used to uniquely identify a previous present with theQueuePresentKHRcommand.desiredPresentTime– an application-provided value that was given to a previousQueuePresentKHRcommand viaVkPresentTimeGOOGLE::desiredPresentTime. If non-zero, it was used by the application to indicate that an image not be presented any sooner thandesiredPresentTime.actualPresentTime– the time when the image of theswapchainwas actually displayed.earliestPresentTime– the time when the image of theswapchaincould have been displayed. This may differ fromactualPresentTimeif the application requested that the image be presented no sooner thanVkPresentTimeGOOGLE::desiredPresentTime.presentMargin– an indication of how early thevkQueuePresentKHRcommand was processed compared to how soon it needed to be processed, and still be presented atearliestPresentTime.
Layout
struct VkPastPresentationTimingGOOGLE { uint32_t presentID; uint64_t desiredPresentTime; uint64_t actualPresentTime; uint64_t earliestPresentTime; uint64_t presentMargin; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkPastPresentationTimingGOOGLE.BufferAn array ofVkPastPresentationTimingGOOGLEstructs.
-
Field Summary
Fields Modifier and Type Field Description static intACTUALPRESENTTIMEThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intDESIREDPRESENTTIME
EARLIESTPRESENTTIME
PRESENTID
PRESENTMARGINThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkPastPresentationTimingGOOGLE(java.nio.ByteBuffer container)Creates aVkPastPresentationTimingGOOGLEinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longactualPresentTime()Returns the value of theactualPresentTimefield.static VkPastPresentationTimingGOOGLEcalloc()Returns a newVkPastPresentationTimingGOOGLEinstance allocated withmemCalloc.static VkPastPresentationTimingGOOGLE.Buffercalloc(int capacity)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated withmemCalloc.static VkPastPresentationTimingGOOGLEcallocStack()Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkPastPresentationTimingGOOGLE.BuffercallocStack(int capacity)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkPastPresentationTimingGOOGLE.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkPastPresentationTimingGOOGLEcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkPastPresentationTimingGOOGLEcreate()Returns a newVkPastPresentationTimingGOOGLEinstance allocated withBufferUtils.static VkPastPresentationTimingGOOGLE.Buffercreate(int capacity)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated withBufferUtils.static VkPastPresentationTimingGOOGLEcreate(long address)Returns a newVkPastPresentationTimingGOOGLEinstance for the specified memory address.static VkPastPresentationTimingGOOGLE.Buffercreate(long address, int capacity)Create aVkPastPresentationTimingGOOGLE.Bufferinstance at the specified memory.static VkPastPresentationTimingGOOGLEcreateSafe(long address)static VkPastPresentationTimingGOOGLE.BuffercreateSafe(long address, int capacity)longdesiredPresentTime()Returns the value of thedesiredPresentTimefield.longearliestPresentTime()Returns the value of theearliestPresentTimefield.static VkPastPresentationTimingGOOGLEmalloc()Returns a newVkPastPresentationTimingGOOGLEinstance allocated withmemAlloc.static VkPastPresentationTimingGOOGLE.Buffermalloc(int capacity)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated withmemAlloc.static VkPastPresentationTimingGOOGLEmallocStack()Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the thread-localMemoryStack.static VkPastPresentationTimingGOOGLE.BuffermallocStack(int capacity)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the thread-localMemoryStack.static VkPastPresentationTimingGOOGLE.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the specifiedMemoryStack.static VkPastPresentationTimingGOOGLEmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the specifiedMemoryStack.static longnactualPresentTime(long struct)Unsafe version ofactualPresentTime().static longndesiredPresentTime(long struct)Unsafe version ofdesiredPresentTime().static longnearliestPresentTime(long struct)Unsafe version ofearliestPresentTime().static intnpresentID(long struct)Unsafe version ofpresentID().static longnpresentMargin(long struct)Unsafe version ofpresentMargin().intpresentID()Returns the value of thepresentIDfield.longpresentMargin()Returns the value of thepresentMarginfield.intsizeof()
-
-
-
Constructor Detail
-
VkPastPresentationTimingGOOGLE
public VkPastPresentationTimingGOOGLE(java.nio.ByteBuffer container)
Creates aVkPastPresentationTimingGOOGLEinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
presentID
public int presentID()
Returns the value of thepresentIDfield.
-
desiredPresentTime
public long desiredPresentTime()
Returns the value of thedesiredPresentTimefield.
-
actualPresentTime
public long actualPresentTime()
Returns the value of theactualPresentTimefield.
-
earliestPresentTime
public long earliestPresentTime()
Returns the value of theearliestPresentTimefield.
-
presentMargin
public long presentMargin()
Returns the value of thepresentMarginfield.
-
malloc
public static VkPastPresentationTimingGOOGLE malloc()
Returns a newVkPastPresentationTimingGOOGLEinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkPastPresentationTimingGOOGLE calloc()
Returns a newVkPastPresentationTimingGOOGLEinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkPastPresentationTimingGOOGLE create()
Returns a newVkPastPresentationTimingGOOGLEinstance allocated withBufferUtils.
-
create
public static VkPastPresentationTimingGOOGLE create(long address)
Returns a newVkPastPresentationTimingGOOGLEinstance for the specified memory address.
-
createSafe
@Nullable public static VkPastPresentationTimingGOOGLE createSafe(long address)
-
malloc
public static VkPastPresentationTimingGOOGLE.Buffer malloc(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkPastPresentationTimingGOOGLE.Buffer calloc(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkPastPresentationTimingGOOGLE.Buffer create(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkPastPresentationTimingGOOGLE.Buffer create(long address, int capacity)
Create aVkPastPresentationTimingGOOGLE.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static VkPastPresentationTimingGOOGLE.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VkPastPresentationTimingGOOGLE mallocStack()
Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkPastPresentationTimingGOOGLE callocStack()
Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkPastPresentationTimingGOOGLE mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkPastPresentationTimingGOOGLE callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLEinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static VkPastPresentationTimingGOOGLE.Buffer mallocStack(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkPastPresentationTimingGOOGLE.Buffer callocStack(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkPastPresentationTimingGOOGLE.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static VkPastPresentationTimingGOOGLE.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
npresentID
public static int npresentID(long struct)
Unsafe version ofpresentID().
-
ndesiredPresentTime
public static long ndesiredPresentTime(long struct)
Unsafe version ofdesiredPresentTime().
-
nactualPresentTime
public static long nactualPresentTime(long struct)
Unsafe version ofactualPresentTime().
-
nearliestPresentTime
public static long nearliestPresentTime(long struct)
Unsafe version ofearliestPresentTime().
-
npresentMargin
public static long npresentMargin(long struct)
Unsafe version ofpresentMargin().
-
-