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.NativeResourceThis 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
GetPerfStatsat the native refresh rate of the HMD thenFrameStatsCountwill be 1. If the app's workload happens to forceGetPerfStatsto be called at a lower rate, thenFrameStatsCountwill 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
SubmitFrameandGetPerfStatsat 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 callsSubmitFrameat a rate less than 18 fps, then when callingGetPerfStats, expectAnyFrameStatsDroppedto becomeTruewhileFrameStatsCountis 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
AdaptiveGpuPerformanceScaleis 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 {ovrPerfStatsPerCompositorFrameFrameStats[ovrMaxProvidedFrameStats]; int FrameStatsCount; ovrBool AnyFrameStatsDropped; float AdaptiveGpuPerformanceScale; ovrBool AswIsAvailable; ovrProcessId VisibleProcessId; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOVRPerfStats.BufferAn array ofOVRPerfStatsstructs.
-
Field Summary
Fields Modifier and Type Field Description static intADAPTIVEGPUPERFORMANCESCALEThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intANYFRAMESTATSDROPPED
ASWISAVAILABLE
FRAMESTATS
FRAMESTATSCOUNTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intVISIBLEPROCESSIDThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRPerfStats(java.nio.ByteBuffer container)Creates aOVRPerfStatsinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatAdaptiveGpuPerformanceScale()Returns the value of theAdaptiveGpuPerformanceScalefield.booleanAnyFrameStatsDropped()Returns the value of theAnyFrameStatsDroppedfield.booleanAswIsAvailable()Returns the value of theAswIsAvailablefield.static OVRPerfStatscalloc()Returns a newOVRPerfStatsinstance allocated withmemCalloc.static OVRPerfStats.Buffercalloc(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated withmemCalloc.static OVRPerfStatscallocStack()Returns a newOVRPerfStatsinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRPerfStats.BuffercallocStack(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRPerfStats.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStats.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRPerfStatscallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRPerfStatscreate()Returns a newOVRPerfStatsinstance allocated withBufferUtils.static OVRPerfStats.Buffercreate(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated withBufferUtils.static OVRPerfStatscreate(long address)Returns a newOVRPerfStatsinstance for the specified memory address.static OVRPerfStats.Buffercreate(long address, int capacity)Create aOVRPerfStats.Bufferinstance at the specified memory.static OVRPerfStatscreateSafe(long address)static OVRPerfStats.BuffercreateSafe(long address, int capacity)OVRPerfStatsPerCompositorFrame.BufferFrameStats()Returns aOVRPerfStatsPerCompositorFrame.Buffer view of theFrameStatsfield.OVRPerfStatsPerCompositorFrameFrameStats(int index)Returns aOVRPerfStatsPerCompositorFrameview of the struct at the specified index of theFrameStatsfield.intFrameStatsCount()Returns the value of theFrameStatsCountfield.static OVRPerfStatsmalloc()Returns a newOVRPerfStatsinstance allocated withmemAlloc.static OVRPerfStats.Buffermalloc(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated withmemAlloc.static OVRPerfStatsmallocStack()Returns a newOVRPerfStatsinstance allocated on the thread-localMemoryStack.static OVRPerfStats.BuffermallocStack(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated on the thread-localMemoryStack.static OVRPerfStats.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStats.Bufferinstance allocated on the specifiedMemoryStack.static OVRPerfStatsmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStack.static floatnAdaptiveGpuPerformanceScale(long struct)Unsafe version ofAdaptiveGpuPerformanceScale().static booleannAnyFrameStatsDropped(long struct)Unsafe version ofAnyFrameStatsDropped().static booleannAswIsAvailable(long struct)Unsafe version ofAswIsAvailable().static OVRPerfStatsPerCompositorFrame.BuffernFrameStats(long struct)Unsafe version ofFrameStats().static OVRPerfStatsPerCompositorFramenFrameStats(long struct, int index)Unsafe version ofFrameStats.static intnFrameStatsCount(long struct)Unsafe version ofFrameStatsCount().static intnVisibleProcessId(long struct)Unsafe version ofVisibleProcessId().intsizeof()intVisibleProcessId()Returns the value of theVisibleProcessIdfield.
-
-
-
Constructor Detail
-
OVRPerfStats
public OVRPerfStats(java.nio.ByteBuffer container)
Creates aOVRPerfStatsinstance 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
-
FrameStats
public OVRPerfStatsPerCompositorFrame.Buffer FrameStats()
Returns aOVRPerfStatsPerCompositorFrame.Buffer view of theFrameStatsfield.
-
FrameStats
public OVRPerfStatsPerCompositorFrame FrameStats(int index)
Returns aOVRPerfStatsPerCompositorFrameview of the struct at the specified index of theFrameStatsfield.
-
FrameStatsCount
public int FrameStatsCount()
Returns the value of theFrameStatsCountfield.
-
AnyFrameStatsDropped
public boolean AnyFrameStatsDropped()
Returns the value of theAnyFrameStatsDroppedfield.
-
AdaptiveGpuPerformanceScale
public float AdaptiveGpuPerformanceScale()
Returns the value of theAdaptiveGpuPerformanceScalefield.
-
AswIsAvailable
public boolean AswIsAvailable()
Returns the value of theAswIsAvailablefield.
-
VisibleProcessId
public int VisibleProcessId()
Returns the value of theVisibleProcessIdfield.
-
malloc
public static OVRPerfStats malloc()
Returns a newOVRPerfStatsinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRPerfStats calloc()
Returns a newOVRPerfStatsinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRPerfStats create()
Returns a newOVRPerfStatsinstance allocated withBufferUtils.
-
create
public static OVRPerfStats create(long address)
Returns a newOVRPerfStatsinstance for the specified memory address.
-
createSafe
@Nullable public static OVRPerfStats createSafe(long address)
-
malloc
public static OVRPerfStats.Buffer malloc(int capacity)
Returns a newOVRPerfStats.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRPerfStats.Buffer calloc(int capacity)
Returns a newOVRPerfStats.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRPerfStats.Buffer create(int capacity)
Returns a newOVRPerfStats.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRPerfStats.Buffer create(long address, int capacity)
Create aOVRPerfStats.Bufferinstance 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 newOVRPerfStatsinstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRPerfStats callocStack()
Returns a newOVRPerfStatsinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRPerfStats mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRPerfStats callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRPerfStats.Buffer callocStack(int capacity)
Returns a newOVRPerfStats.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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().
-
-