Top Description Inners Fields Constructors Methods
org.lwjgl.ovr

public Class OVRPerfStats

extends Struct<OVRPerfStats>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct ovrPerfStats
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

This is a complete descriptor of the performance stats provided by the SDK.

Layout


struct ovrPerfStats {
    ovrPerfStatsPerCompositorFrame FrameStats[ovrMaxProvidedFrameStats];
    int FrameStatsCount;
    ovrBool AnyFrameStatsDropped;
    float AdaptiveGpuPerformanceScale;
    ovrBool AswIsAvailable;
    ovrProcessId VisibleProcessId;
}

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
OVRPerfStats.Buffer

An array of OVRPerfStats structs.

Field Summary

Modifier and TypeField and Description
public static final int
ADAPTIVEGPUPERFORMANCESCALE

The struct member offsets.

public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
ANYFRAMESTATSDROPPED

The struct member offsets.

public static final int
ASWISAVAILABLE

The struct member offsets.

public static final int
FRAMESTATS

The struct member offsets.

public static final int
FRAMESTATSCOUNT

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
VISIBLEPROCESSID

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
OVRPerfStats(long address, ByteBuffer container)

public
OVRPerfStats(ByteBuffer container)

Creates a OVRPerfStats instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
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.

public boolean
AnyFrameStatsDropped()

If the app calls SubmitFrame at a rate less than 18 fps, then when calling GetPerfStats, expect AnyFrameStatsDropped to become True while FrameStatsCount is equal to MaxProvidedFrameStats.

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.

public static OVRPerfStats
calloc()

Returns a new OVRPerfStats instance allocated with memCalloc.

public static OVRPerfStats.Buffer
calloc(int
the buffer capacity
capacity
)

Returns a new OVRPerfStats.Buffer instance allocated with memCalloc.

public static OVRPerfStats
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new OVRPerfStats instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static OVRPerfStats.Buffer
calloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new OVRPerfStats.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static OVRPerfStats
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static OVRPerfStats
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static OVRPerfStats.Buffer
callocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static OVRPerfStats.Buffer
callocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
protected OVRPerfStats
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static OVRPerfStats
create()

Returns a new OVRPerfStats instance allocated with BufferUtils.

public static OVRPerfStats
create(long address)

Returns a new OVRPerfStats instance for the specified memory address.

public static OVRPerfStats.Buffer
create(int
the buffer capacity
capacity
)

Returns a new OVRPerfStats.Buffer instance allocated with BufferUtils.

public static OVRPerfStats.Buffer
create(long
the memory address
address
,
int
the buffer capacity
capacity
)

Create a OVRPerfStats.Buffer instance at the specified memory.

public static OVRPerfStats
createSafe(long address)

Like create, but returns null if address is NULL.

public static OVRPerfStats.Buffer
createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

public OVRPerfStatsPerCompositorFrame.Buffer
FrameStats()

an array of performance stats.

public OVRPerfStatsPerCompositorFrame
FrameStats(int index)

an array of performance stats.

public int
FrameStatsCount()

will have a maximum value set by MaxProvidedFrameStats.

public static OVRPerfStats
malloc()

Returns a new OVRPerfStats instance allocated with memAlloc.

public static OVRPerfStats.Buffer
malloc(int
the buffer capacity
capacity
)

Returns a new OVRPerfStats.Buffer instance allocated with memAlloc.

public static OVRPerfStats
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new OVRPerfStats instance allocated on the specified MemoryStack.

public static OVRPerfStats.Buffer
malloc(int
the buffer capacity
capacity
,
MemoryStack
the stack from which to allocate
stack
)

Returns a new OVRPerfStats.Buffer instance allocated on the specified MemoryStack.

public static OVRPerfStats
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static OVRPerfStats
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static OVRPerfStats.Buffer
mallocStack(int capacity)

Deprecated
Deprecated for removal in 3.4.0.
public static OVRPerfStats.Buffer
mallocStack(int capacity, MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static float
public static boolean
nAnyFrameStatsDropped(long struct)

Unsafe version of AnyFrameStatsDropped.

public static boolean
nAswIsAvailable(long struct)

Unsafe version of AswIsAvailable.

public static OVRPerfStatsPerCompositorFrame.Buffer
nFrameStats(long struct)

Unsafe version of FrameStats.

public static OVRPerfStatsPerCompositorFrame
nFrameStats(long struct, int index)

Unsafe version of FrameStats.

public static int
nFrameStatsCount(long struct)

Unsafe version of FrameStatsCount.

public static int
nVisibleProcessId(long struct)

Unsafe version of VisibleProcessId.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public int
VisibleProcessId()

Contains the Process ID of the VR application the stats are being polled for.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ADAPTIVEGPUPERFORMANCESCALEback to summary
public static final int ADAPTIVEGPUPERFORMANCESCALE

The struct member offsets.

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

ANYFRAMESTATSDROPPEDback to summary
public static final int ANYFRAMESTATSDROPPED

The struct member offsets.

ASWISAVAILABLEback to summary
public static final int ASWISAVAILABLE

The struct member offsets.

FRAMESTATSback to summary
public static final int FRAMESTATS

The struct member offsets.

FRAMESTATSCOUNTback to summary
public static final int FRAMESTATSCOUNT

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

VISIBLEPROCESSIDback to summary
public static final int VISIBLEPROCESSID

The struct member offsets.

Constructor Detail

OVRPerfStatsback to summary
protected OVRPerfStats(long address, ByteBuffer container)
OVRPerfStatsback to summary
public OVRPerfStats(ByteBuffer container)

Creates a OVRPerfStats instance at the current position of the specified ByteBuffer 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

AdaptiveGpuPerformanceScaleback to summary
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 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.

AnyFrameStatsDroppedback to summary
public boolean AnyFrameStatsDropped()

If the app calls SubmitFrame at a rate less than 18 fps, then when calling GetPerfStats, expect AnyFrameStatsDropped to become True while FrameStatsCount is equal to MaxProvidedFrameStats.

Annotations
@NativeType:ovrBool
AswIsAvailableback to summary
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.

Annotations
@NativeType:ovrBool
callocback to summary
public static OVRPerfStats calloc()

Returns a new OVRPerfStats instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static OVRPerfStats.Buffer calloc(int capacity)

Returns a new OVRPerfStats.Buffer instance allocated with memCalloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

callocback to summary
public static OVRPerfStats calloc(MemoryStack stack)

Returns a new OVRPerfStats instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocback to summary
public static OVRPerfStats.Buffer calloc(int capacity, MemoryStack stack)

Returns a new OVRPerfStats.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static OVRPerfStats callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static OVRPerfStats callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static OVRPerfStats.Buffer callocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static OVRPerfStats.Buffer callocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.

Annotations
@Deprecated
createback to summary
protected OVRPerfStats create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static OVRPerfStats create()

Returns a new OVRPerfStats instance allocated with BufferUtils.

createback to summary
public static OVRPerfStats create(long address)

Returns a new OVRPerfStats instance for the specified memory address.

createback to summary
public static OVRPerfStats.Buffer create(int capacity)

Returns a new OVRPerfStats.Buffer instance allocated with BufferUtils.

Parameters
capacity:int

the buffer capacity

createback to summary
public static OVRPerfStats.Buffer create(long address, int capacity)

Create a OVRPerfStats.Buffer instance at the specified memory.

Parameters
address:long

the memory address

capacity:int

the buffer capacity

createSafeback to summary
public static OVRPerfStats createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
createSafeback to summary
public static OVRPerfStats.Buffer createSafe(long address, int capacity)

Like create, but returns null if address is NULL.

Annotations
@Nullable
FrameStatsback to summary
public OVRPerfStatsPerCompositorFrame.Buffer 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.

Annotations
@NativeType:ovrPerfStatsPerCompositorFrame[ovrMaxProvidedFrameStats]
FrameStatsback to summary
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.

Annotations
@NativeType:ovrPerfStatsPerCompositorFrame
FrameStatsCountback to summary
public int FrameStatsCount()

will have a maximum value set by MaxProvidedFrameStats.

If the application calls GetPerfStats at the native refresh rate of the HMD then FrameStatsCount will be 1. If the app's workload happens to force GetPerfStats to be called at a lower rate, then FrameStatsCount 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 and GetPerfStats 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.

mallocback to summary
public static OVRPerfStats malloc()

Returns a new OVRPerfStats instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static OVRPerfStats.Buffer malloc(int capacity)

Returns a new OVRPerfStats.Buffer instance allocated with memAlloc. The instance must be explicitly freed.

Parameters
capacity:int

the buffer capacity

mallocback to summary
public static OVRPerfStats malloc(MemoryStack stack)

Returns a new OVRPerfStats instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocback to summary
public static OVRPerfStats.Buffer malloc(int capacity, MemoryStack stack)

Returns a new OVRPerfStats.Buffer instance allocated on the specified MemoryStack.

Parameters
capacity:int

the buffer capacity

stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static OVRPerfStats mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static OVRPerfStats mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static OVRPerfStats.Buffer mallocStack(int capacity)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static OVRPerfStats.Buffer mallocStack(int capacity, MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.

Annotations
@Deprecated
nAdaptiveGpuPerformanceScaleback to summary
public static float nAdaptiveGpuPerformanceScale(long struct)

Unsafe version of AdaptiveGpuPerformanceScale.

nAnyFrameStatsDroppedback to summary
public static boolean nAnyFrameStatsDropped(long struct)

Unsafe version of AnyFrameStatsDropped.

nAswIsAvailableback to summary
public static boolean nAswIsAvailable(long struct)

Unsafe version of AswIsAvailable.

nFrameStatsback to summary
public static OVRPerfStatsPerCompositorFrame.Buffer nFrameStats(long struct)

Unsafe version of FrameStats.

nFrameStatsback to summary
public static OVRPerfStatsPerCompositorFrame nFrameStats(long struct, int index)

Unsafe version of FrameStats.

nFrameStatsCountback to summary
public static int nFrameStatsCount(long struct)

Unsafe version of FrameStatsCount.

nVisibleProcessIdback to summary
public static int nVisibleProcessId(long struct)

Unsafe version of VisibleProcessId.

sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
VisibleProcessIdback to summary
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).

Annotations
@NativeType:ovrProcessId
org.lwjgl.ovr back to summary

public Class OVRPerfStats.Buffer

extends StructBuffer<OVRPerfStats, OVRPerfStats.Buffer>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable

An array of OVRPerfStats structs.

Field Summary

Modifier and TypeField and Description
private static final OVRPerfStats

Constructor Summary

AccessConstructor and Description
public
Buffer(ByteBuffer container)

Creates a new OVRPerfStats.Buffer instance backed by the specified container.

public
Buffer(long address, int cap)

pack-priv
Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Summary

Modifier and TypeMethod and Description
public float
public boolean

Returns:

the value of the OVRPerfStats#AnyFrameStatsDropped field.
AnyFrameStatsDropped
()

public boolean

Returns:

the value of the OVRPerfStats#AswIsAvailable field.
AswIsAvailable
()

public OVRPerfStatsPerCompositorFrame.Buffer
public OVRPerfStatsPerCompositorFrame

Returns:

a OVRPerfStatsPerCompositorFrame view of the struct at the specified index of the OVRPerfStats#FrameStats field.
FrameStats
(int index)

public int

Returns:

the value of the OVRPerfStats#FrameStatsCount field.
FrameStatsCount
()

protected OVRPerfStats
protected OVRPerfStats.Buffer
public int

Returns:

the value of the OVRPerfStats#VisibleProcessId field.
VisibleProcessId
()

Inherited from org.lwjgl.system.StructBuffer:
applyapplyforEachgetgetgetgetiteratorparallelStreamputputsizeofspliteratorstream

Field Detail

ELEMENT_FACTORYback to summary
private static final OVRPerfStats ELEMENT_FACTORY

Constructor Detail

Bufferback to summary
public Buffer(ByteBuffer container)

Creates a new OVRPerfStats.Buffer instance backed by the specified container.

Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided by OVRPerfStats#SIZEOF, and its mark will be undefined.

The created buffer instance holds a strong reference to the container object.

Bufferback to summary
public Buffer(long address, int cap)
Bufferback to summary
pack-priv Buffer(long address, ByteBuffer container, int mark, int pos, int lim, int cap)

Method Detail

AdaptiveGpuPerformanceScaleback to summary
public float AdaptiveGpuPerformanceScale()
Returns:float

the value of the OVRPerfStats#AdaptiveGpuPerformanceScale field.

AnyFrameStatsDroppedback to summary
public boolean AnyFrameStatsDropped()
Returns:boolean

the value of the OVRPerfStats#AnyFrameStatsDropped field.

Annotations
@NativeType:ovrBool
AswIsAvailableback to summary
public boolean AswIsAvailable()
Returns:boolean

the value of the OVRPerfStats#AswIsAvailable field.

Annotations
@NativeType:ovrBool
FrameStatsback to summary
public OVRPerfStatsPerCompositorFrame.Buffer FrameStats()
Returns:OVRPerfStatsPerCompositorFrame.Buffer

a OVRPerfStatsPerCompositorFrame.Buffer view of the OVRPerfStats#FrameStats field.

Annotations
@NativeType:ovrPerfStatsPerCompositorFrame[ovrMaxProvidedFrameStats]
FrameStatsback to summary
public OVRPerfStatsPerCompositorFrame FrameStats(int index)
Returns:OVRPerfStatsPerCompositorFrame

a OVRPerfStatsPerCompositorFrame view of the struct at the specified index of the OVRPerfStats#FrameStats field.

Annotations
@NativeType:ovrPerfStatsPerCompositorFrame
FrameStatsCountback to summary
public int FrameStatsCount()
Returns:int

the value of the OVRPerfStats#FrameStatsCount field.

getElementFactoryback to summary
protected OVRPerfStats getElementFactory()

Implements abstract org.lwjgl.system.StructBuffer.getElementFactory.

Annotations
@Override
selfback to summary
protected OVRPerfStats.Buffer self()

Implements abstract org.lwjgl.system.CustomBuffer.self.

Annotations
@Override
VisibleProcessIdback to summary
public int VisibleProcessId()
Returns:int

the value of the OVRPerfStats#VisibleProcessId field.

Annotations
@NativeType:ovrProcessId