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.NativeResource
Structure containing timing information about a previously-presented image.Description
The results for a given
swapchain
andpresentID
are only returned once fromvkGetPastPresentationTimingGOOGLE
.The application can use the
VkPastPresentationTimingGOOGLE
values to occasionally adjust its timing. For example, ifactualPresentTime
is later than expected (e.g. onerefreshDuration
late), the application may increase its target IPD to a higher multiple ofrefreshDuration
(e.g. decrease its frame rate from 60Hz to 30Hz). IfactualPresentTime
andearliestPresentTime
are consistently different, and ifpresentMargin
is 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). IfactualPresentTime
andearliestPresentTime
are same, and ifpresentMargin
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 asrefreshDuration
, can also adjust features untilactualPresentTime
is never late andpresentMargin
is satisfactory.See Also
GetPastPresentationTimingGOOGLE
Member documentation
presentID
– an application-provided value that was given to a previousvkQueuePresentKHR
command viaVkPresentTimeGOOGLE
::presentID
(see below). It can be used to uniquely identify a previous present with theQueuePresentKHR
command.desiredPresentTime
– an application-provided value that was given to a previousQueuePresentKHR
command 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 theswapchain
was actually displayed.earliestPresentTime
– the time when the image of theswapchain
could have been displayed. This may differ fromactualPresentTime
if the application requested that the image be presented no sooner thanVkPresentTimeGOOGLE
::desiredPresentTime
.presentMargin
– an indication of how early thevkQueuePresentKHR
command 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 class
VkPastPresentationTimingGOOGLE.Buffer
An array ofVkPastPresentationTimingGOOGLE
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ACTUALPRESENTTIME
The struct member offsets.static int
ALIGNOF
The struct alignment in bytes.static int
DESIREDPRESENTTIME
EARLIESTPRESENTTIME
PRESENTID
PRESENTMARGINThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VkPastPresentationTimingGOOGLE(java.nio.ByteBuffer container)
Creates aVkPastPresentationTimingGOOGLE
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
actualPresentTime()
Returns the value of theactualPresentTime
field.static VkPastPresentationTimingGOOGLE
calloc()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated withmemCalloc
.static VkPastPresentationTimingGOOGLE.Buffer
calloc(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated withmemCalloc
.static VkPastPresentationTimingGOOGLE
callocStack()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkPastPresentationTimingGOOGLE.Buffer
callocStack(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkPastPresentationTimingGOOGLE.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkPastPresentationTimingGOOGLE
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkPastPresentationTimingGOOGLE
create()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated withBufferUtils
.static VkPastPresentationTimingGOOGLE.Buffer
create(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated withBufferUtils
.static VkPastPresentationTimingGOOGLE
create(long address)
Returns a newVkPastPresentationTimingGOOGLE
instance for the specified memory address.static VkPastPresentationTimingGOOGLE.Buffer
create(long address, int capacity)
Create aVkPastPresentationTimingGOOGLE.Buffer
instance at the specified memory.static VkPastPresentationTimingGOOGLE
createSafe(long address)
static VkPastPresentationTimingGOOGLE.Buffer
createSafe(long address, int capacity)
long
desiredPresentTime()
Returns the value of thedesiredPresentTime
field.long
earliestPresentTime()
Returns the value of theearliestPresentTime
field.static VkPastPresentationTimingGOOGLE
malloc()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated withmemAlloc
.static VkPastPresentationTimingGOOGLE.Buffer
malloc(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated withmemAlloc
.static VkPastPresentationTimingGOOGLE
mallocStack()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the thread-localMemoryStack
.static VkPastPresentationTimingGOOGLE.Buffer
mallocStack(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated on the thread-localMemoryStack
.static VkPastPresentationTimingGOOGLE.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated on the specifiedMemoryStack
.static VkPastPresentationTimingGOOGLE
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the specifiedMemoryStack
.static long
nactualPresentTime(long struct)
Unsafe version ofactualPresentTime()
.static long
ndesiredPresentTime(long struct)
Unsafe version ofdesiredPresentTime()
.static long
nearliestPresentTime(long struct)
Unsafe version ofearliestPresentTime()
.static int
npresentID(long struct)
Unsafe version ofpresentID()
.static long
npresentMargin(long struct)
Unsafe version ofpresentMargin()
.int
presentID()
Returns the value of thepresentID
field.long
presentMargin()
Returns the value of thepresentMargin
field.int
sizeof()
-
-
-
Constructor Detail
-
VkPastPresentationTimingGOOGLE
public VkPastPresentationTimingGOOGLE(java.nio.ByteBuffer container)
Creates aVkPastPresentationTimingGOOGLE
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
presentID
public int presentID()
Returns the value of thepresentID
field.
-
desiredPresentTime
public long desiredPresentTime()
Returns the value of thedesiredPresentTime
field.
-
actualPresentTime
public long actualPresentTime()
Returns the value of theactualPresentTime
field.
-
earliestPresentTime
public long earliestPresentTime()
Returns the value of theearliestPresentTime
field.
-
presentMargin
public long presentMargin()
Returns the value of thepresentMargin
field.
-
malloc
public static VkPastPresentationTimingGOOGLE malloc()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkPastPresentationTimingGOOGLE calloc()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkPastPresentationTimingGOOGLE create()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated withBufferUtils
.
-
create
public static VkPastPresentationTimingGOOGLE create(long address)
Returns a newVkPastPresentationTimingGOOGLE
instance for the specified memory address.
-
createSafe
@Nullable public static VkPastPresentationTimingGOOGLE createSafe(long address)
-
malloc
public static VkPastPresentationTimingGOOGLE.Buffer malloc(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkPastPresentationTimingGOOGLE.Buffer calloc(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkPastPresentationTimingGOOGLE.Buffer create(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkPastPresentationTimingGOOGLE.Buffer create(long address, int capacity)
Create aVkPastPresentationTimingGOOGLE.Buffer
instance 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 newVkPastPresentationTimingGOOGLE
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkPastPresentationTimingGOOGLE callocStack()
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkPastPresentationTimingGOOGLE mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkPastPresentationTimingGOOGLE callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkPastPresentationTimingGOOGLE
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkPastPresentationTimingGOOGLE.Buffer callocStack(int capacity)
Returns a newVkPastPresentationTimingGOOGLE.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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()
.
-
-