Class OVRPerfStats
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Layout
struct ovrPerfStats {
ovrPerfStatsPerCompositorFrame FrameStats()[ovrMaxProvidedFrameStats];
int FrameStatsCount();
ovrBool AnyFrameStatsDropped();
float AdaptiveGpuPerformanceScale();
ovrBool AswIsAvailable();
ovrProcessId VisibleProcessId();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct member offsets.static final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionOVRPerfStats(ByteBuffer container) Creates aOVRPerfStatsinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionfloatan edge-filtered value that a caller can use to adjust the graphics quality of the application to keep the GPU utilization in check.booleanIf the app callsSubmitFrameat a rate less than 18 fps, then when callingGetPerfStats, expectAnyFrameStatsDroppedto becomeTruewhileFrameStatsCountis equal toMaxProvidedFrameStats.booleanWill 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 OVRPerfStatsDeprecated.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 @Nullable OVRPerfStatscreateSafe(long address) static @Nullable OVRPerfStats.BuffercreateSafe(long address, int capacity) an array of performance stats.FrameStats(int index) an array of performance stats.intwill 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 OVRPerfStatsDeprecated.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().nFrameStats(long struct) Unsafe version ofFrameStats().nFrameStats(long struct, int index) Unsafe version ofFrameStats.static intnFrameStatsCount(long struct) Unsafe version ofFrameStatsCount().static intnVisibleProcessId(long struct) Unsafe version ofVisibleProcessId().intsizeof()intContains the Process ID of the VR application the stats are being polled for.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
FRAMESTATS
public static final int FRAMESTATSThe struct member offsets. -
FRAMESTATSCOUNT
public static final int FRAMESTATSCOUNTThe struct member offsets. -
ANYFRAMESTATSDROPPED
public static final int ANYFRAMESTATSDROPPEDThe struct member offsets. -
ADAPTIVEGPUPERFORMANCESCALE
public static final int ADAPTIVEGPUPERFORMANCESCALEThe struct member offsets. -
ASWISAVAILABLE
public static final int ASWISAVAILABLEThe struct member offsets. -
VISIBLEPROCESSID
public static final int VISIBLEPROCESSIDThe struct member offsets.
-
-
Constructor Details
-
OVRPerfStats
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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<OVRPerfStats>
-
FrameStats
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.
-
FrameStats
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
Returns a newOVRPerfStatsinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newOVRPerfStatsinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newOVRPerfStatsinstance allocated withBufferUtils. -
create
Returns a newOVRPerfStatsinstance for the specified memory address. -
createSafe
-
malloc
Returns a newOVRPerfStats.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newOVRPerfStats.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newOVRPerfStats.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aOVRPerfStats.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
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
Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newOVRPerfStatsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newOVRPerfStats.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newOVRPerfStats.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nFrameStats
Unsafe version ofFrameStats(). -
nFrameStats
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().
-