Class OVRPerfStats
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.OVRPerfStats
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class OVRPerfStats extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
This is a complete descriptor of the performance stats provided by the SDK.Member documentation
FrameStats[ovrMaxProvidedFrameStats]
– an array of performance stats.The performance entries will be ordered in reverse chronological order such that the first entry will be the most recent one.
FrameStatsCount
– will have a maximum value set byMaxProvidedFrameStats
.If the application calls
GetPerfStats
at the native refresh rate of the HMD thenFrameStatsCount
will be 1. If the app's workload happens to forceGetPerfStats
to be called at a lower rate, thenFrameStatsCount
will be 2 or more.If the app does not want to miss any performance data for any frame, it needs to ensure that it is calling
SubmitFrame
andGetPerfStats
at a rate that is at least:HMD_refresh_rate / ovrMaxProvidedFrameStats
. On the Oculus Rift CV1 HMD, this will be equal to 18 times per second.AnyFrameStatsDropped
– If the app callsSubmitFrame
at a rate less than 18 fps, then when callingGetPerfStats
, expectAnyFrameStatsDropped
to becomeTrue
whileFrameStatsCount
is equal toMaxProvidedFrameStats
.AdaptiveGpuPerformanceScale
– an edge-filtered value that a caller can use to adjust the graphics quality of the application to keep the GPU utilization in check. The value is calculated as:(desired_GPU_utilization / current_GPU_utilization)
As such, when this value is 1.0, the GPU is doing the right amount of work for the app. Lower values mean the app needs to pull back on the GPU utilization. If the app is going to directly drive render-target resolution using this value, then be sure to take the square-root of the value before scaling the resolution with it. Changing render target resolutions however is one of the many things an app can do increase or decrease the amount of GPU utilization. Since
AdaptiveGpuPerformanceScale
is edge-filtered and does not change rapidly (i.e. reports non-1.0 values once every couple of seconds) the app can make the necessary adjustments and then keep watching the value to see if it has been satisfied.AswIsAvailable
– Will be true if Async Spacewarp (ASW) is available for this system which is dependent on several factors such as choice of GPU, OS and debug overrides.VisibleProcessId
– Contains the Process ID of the VR application the stats are being polled for. If an app continues to grab perf stats even when it is not visible, then expect this value to point to the other VR app that has grabbed focus (i.e. became visible).
Layout
struct ovrPerfStats {
ovrPerfStatsPerCompositorFrame
FrameStats[ovrMaxProvidedFrameStats]; int FrameStatsCount; ovrBool AnyFrameStatsDropped; float AdaptiveGpuPerformanceScale; ovrBool AswIsAvailable; ovrProcessId VisibleProcessId; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OVRPerfStats.Buffer
An array ofOVRPerfStats
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ADAPTIVEGPUPERFORMANCESCALE
The struct member offsets.static int
ALIGNOF
The struct alignment in bytes.static int
ANYFRAMESTATSDROPPED
ASWISAVAILABLE
FRAMESTATS
FRAMESTATSCOUNTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
VISIBLEPROCESSID
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRPerfStats(java.nio.ByteBuffer container)
Creates aOVRPerfStats
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float
AdaptiveGpuPerformanceScale()
Returns the value of theAdaptiveGpuPerformanceScale
field.boolean
AnyFrameStatsDropped()
Returns the value of theAnyFrameStatsDropped
field.boolean
AswIsAvailable()
Returns the value of theAswIsAvailable
field.static OVRPerfStats
calloc()
Returns a newOVRPerfStats
instance allocated withmemCalloc
.static OVRPerfStats.Buffer
calloc(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated withmemCalloc
.static OVRPerfStats
callocStack()
Returns a newOVRPerfStats
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRPerfStats.Buffer
callocStack(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRPerfStats.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRPerfStats
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRPerfStats
create()
Returns a newOVRPerfStats
instance allocated withBufferUtils
.static OVRPerfStats.Buffer
create(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated withBufferUtils
.static OVRPerfStats
create(long address)
Returns a newOVRPerfStats
instance for the specified memory address.static OVRPerfStats.Buffer
create(long address, int capacity)
Create aOVRPerfStats.Buffer
instance at the specified memory.static OVRPerfStats
createSafe(long address)
static OVRPerfStats.Buffer
createSafe(long address, int capacity)
OVRPerfStatsPerCompositorFrame.Buffer
FrameStats()
Returns aOVRPerfStatsPerCompositorFrame
.Buffer view of theFrameStats
field.OVRPerfStatsPerCompositorFrame
FrameStats(int index)
Returns aOVRPerfStatsPerCompositorFrame
view of the struct at the specified index of theFrameStats
field.int
FrameStatsCount()
Returns the value of theFrameStatsCount
field.static OVRPerfStats
malloc()
Returns a newOVRPerfStats
instance allocated withmemAlloc
.static OVRPerfStats.Buffer
malloc(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated withmemAlloc
.static OVRPerfStats
mallocStack()
Returns a newOVRPerfStats
instance allocated on the thread-localMemoryStack
.static OVRPerfStats.Buffer
mallocStack(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated on the thread-localMemoryStack
.static OVRPerfStats.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats.Buffer
instance allocated on the specifiedMemoryStack
.static OVRPerfStats
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats
instance allocated on the specifiedMemoryStack
.static float
nAdaptiveGpuPerformanceScale(long struct)
Unsafe version ofAdaptiveGpuPerformanceScale()
.static boolean
nAnyFrameStatsDropped(long struct)
Unsafe version ofAnyFrameStatsDropped()
.static boolean
nAswIsAvailable(long struct)
Unsafe version ofAswIsAvailable()
.static OVRPerfStatsPerCompositorFrame.Buffer
nFrameStats(long struct)
Unsafe version ofFrameStats()
.static OVRPerfStatsPerCompositorFrame
nFrameStats(long struct, int index)
Unsafe version ofFrameStats
.static int
nFrameStatsCount(long struct)
Unsafe version ofFrameStatsCount()
.static int
nVisibleProcessId(long struct)
Unsafe version ofVisibleProcessId()
.int
sizeof()
int
VisibleProcessId()
Returns the value of theVisibleProcessId
field.
-
-
-
Constructor Detail
-
OVRPerfStats
public OVRPerfStats(java.nio.ByteBuffer container)
Creates aOVRPerfStats
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
-
FrameStats
public OVRPerfStatsPerCompositorFrame.Buffer FrameStats()
Returns aOVRPerfStatsPerCompositorFrame
.Buffer view of theFrameStats
field.
-
FrameStats
public OVRPerfStatsPerCompositorFrame FrameStats(int index)
Returns aOVRPerfStatsPerCompositorFrame
view of the struct at the specified index of theFrameStats
field.
-
FrameStatsCount
public int FrameStatsCount()
Returns the value of theFrameStatsCount
field.
-
AnyFrameStatsDropped
public boolean AnyFrameStatsDropped()
Returns the value of theAnyFrameStatsDropped
field.
-
AdaptiveGpuPerformanceScale
public float AdaptiveGpuPerformanceScale()
Returns the value of theAdaptiveGpuPerformanceScale
field.
-
AswIsAvailable
public boolean AswIsAvailable()
Returns the value of theAswIsAvailable
field.
-
VisibleProcessId
public int VisibleProcessId()
Returns the value of theVisibleProcessId
field.
-
malloc
public static OVRPerfStats malloc()
Returns a newOVRPerfStats
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRPerfStats calloc()
Returns a newOVRPerfStats
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRPerfStats create()
Returns a newOVRPerfStats
instance allocated withBufferUtils
.
-
create
public static OVRPerfStats create(long address)
Returns a newOVRPerfStats
instance for the specified memory address.
-
createSafe
@Nullable public static OVRPerfStats createSafe(long address)
-
malloc
public static OVRPerfStats.Buffer malloc(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRPerfStats.Buffer calloc(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRPerfStats.Buffer create(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRPerfStats.Buffer create(long address, int capacity)
Create aOVRPerfStats.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static OVRPerfStats.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRPerfStats mallocStack()
Returns a newOVRPerfStats
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRPerfStats callocStack()
Returns a newOVRPerfStats
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRPerfStats mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRPerfStats callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static OVRPerfStats.Buffer mallocStack(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRPerfStats.Buffer callocStack(int capacity)
Returns a newOVRPerfStats.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static OVRPerfStats.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static OVRPerfStats.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStats.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nFrameStats
public static OVRPerfStatsPerCompositorFrame.Buffer nFrameStats(long struct)
Unsafe version ofFrameStats()
.
-
nFrameStats
public static OVRPerfStatsPerCompositorFrame nFrameStats(long struct, int index)
Unsafe version ofFrameStats
.
-
nFrameStatsCount
public static int nFrameStatsCount(long struct)
Unsafe version ofFrameStatsCount()
.
-
nAnyFrameStatsDropped
public static boolean nAnyFrameStatsDropped(long struct)
Unsafe version ofAnyFrameStatsDropped()
.
-
nAdaptiveGpuPerformanceScale
public static float nAdaptiveGpuPerformanceScale(long struct)
Unsafe version ofAdaptiveGpuPerformanceScale()
.
-
nAswIsAvailable
public static boolean nAswIsAvailable(long struct)
Unsafe version ofAswIsAvailable()
.
-
nVisibleProcessId
public static int nVisibleProcessId(long struct)
Unsafe version ofVisibleProcessId()
.
-
-