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.Layout
struct ovrPerfStats {ovrPerfStatsPerCompositorFrameFrameStats()[ovrMaxProvidedFrameStats]; intFrameStatsCount(); ovrBoolAnyFrameStatsDropped(); floatAdaptiveGpuPerformanceScale(); ovrBoolAswIsAvailable(); ovrProcessIdVisibleProcessId(); }
-
-
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 Deprecated Methods Modifier and Type Method Description floatAdaptiveGpuPerformanceScale()an edge-filtered value that a caller can use to adjust the graphics quality of the application to keep the GPU utilization in check.booleanAnyFrameStatsDropped()If the app callsSubmitFrameat a rate less than 18 fps, then when callingGetPerfStats, expectAnyFrameStatsDroppedto becomeTruewhileFrameStatsCountis equal toMaxProvidedFrameStats.booleanAswIsAvailable()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.static OVRPerfStatscalloc()Returns a newOVRPerfStatsinstance allocated withmemCalloc.static OVRPerfStats.Buffercalloc(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated withmemCalloc.static OVRPerfStats.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStats.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRPerfStatscalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRPerfStatscallocStack()Deprecated.static OVRPerfStats.BuffercallocStack(int capacity)Deprecated.static OVRPerfStats.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRPerfStatscallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()an array of performance stats.OVRPerfStatsPerCompositorFrameFrameStats(int index)an array of performance stats.intFrameStatsCount()will have a maximum value set byMaxProvidedFrameStats.static OVRPerfStatsmalloc()Returns a newOVRPerfStatsinstance allocated withmemAlloc.static OVRPerfStats.Buffermalloc(int capacity)Returns a newOVRPerfStats.Bufferinstance allocated withmemAlloc.static OVRPerfStats.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStats.Bufferinstance allocated on the specifiedMemoryStack.static OVRPerfStatsmalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStack.static OVRPerfStatsmallocStack()Deprecated.static OVRPerfStats.BuffermallocStack(int capacity)Deprecated.static OVRPerfStats.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRPerfStatsmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()Contains the Process ID of the VR application the stats are being polled for.
-
-
-
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() public OVRPerfStatsPerCompositorFrame FrameStats(int index)
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
public int 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
public boolean AnyFrameStatsDropped()
If the app callsSubmitFrameat a rate less than 18 fps, then when callingGetPerfStats, expectAnyFrameStatsDroppedto becomeTruewhileFrameStatsCountis equal toMaxProvidedFrameStats.
-
AdaptiveGpuPerformanceScale
public float 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
public boolean 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
public int 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).
-
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
@Deprecated public static OVRPerfStats mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRPerfStats callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRPerfStats mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRPerfStats callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRPerfStats.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static OVRPerfStats.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRPerfStats.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static OVRPerfStats.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static OVRPerfStats malloc(org.lwjgl.system.MemoryStack stack)
Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static OVRPerfStats calloc(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
-
malloc
public static OVRPerfStats.Buffer malloc(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
-
calloc
public static OVRPerfStats.Buffer calloc(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().
-
-