Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class METAPerformanceMetrics

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

The XR_META_performance_metrics extension.

This extension provides APIs to enumerate and query performance metrics counters of the current XR device and XR application. Developers can perform performance analysis and do targeted optimization to the XR application using the performance metrics counters being collected. The application should not change its behavior based on the counter reads.

The performance metrics counters are organized into predefined XrPath values, under the root path pathname:/perfmetrics_meta. An application can query the available counters through EnumeratePerformanceMetricsCounterPathsMETA. Here is a list of the performance metrics counter paths that may be provided on Meta devices:

After a session is created, an application can use SetPerformanceMetricsStateMETA to enable the performance metrics system for that session. An application can use QueryPerformanceMetricsCounterMETA to query a performance metrics counter on a session that has the performance metrics system enabled, or use GetPerformanceMetricsStateMETA to query if the performance metrics system is enabled.

Note

the measurement intervals of individual performance metrics counters are defined by the OpenXR runtime. The application must not make assumptions or change its behavior at runtime by measuring them.

In order to enable the functionality of this extension, the application must pass the name of the extension into CreateInstance via the XrInstanceCreateInfo::enabledExtensionNames parameter as indicated in the extensions section.

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
XR_META_performance_metrics_SPEC_VERSION

The extension specification version.

public static final int
XR_PERFORMANCE_METRICS_COUNTER_ANY_VALUE_VALID_BIT_META

XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions

public static final int
XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_META

XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions

public static final int
XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_META

XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA Flag Descriptions

public static final int
XR_PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description

EnumDescription PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
public static final int
XR_PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description

EnumDescription PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
public static final int
XR_PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description

EnumDescription PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
public static final int
XR_PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description

EnumDescription PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
public static final int
XR_PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA Description

EnumDescription PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance instance, int
the capacity of the counterPaths array, or 0 to indicate a request to retrieve the required capacity.
counterPathCapacityInput
,
long counterPathCountOutput, long counterPaths)

Unsafe version of: EnumeratePerformanceMetricsCounterPathsMETA

public static int
public static int
nxrQueryPerformanceMetricsCounterMETA(XrSession session, long counterPath, long counter)

Unsafe version of: QueryPerformanceMetricsCounterMETA

public static int
public static int
xrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance
an XrInstance handle previously created with CreateInstance.
instance
,
IntBuffer
filled in by the runtime with the count of counterPaths written or the required capacity in the case that counterPathCapacityInput is insufficient.
counterPathCountOutput
,
LongBuffer
an array of XrPath filled in by the runtime which contains all the available performance metrics counters, but can be NULL if counterPathCapacityInput is 0.
counterPaths
)

Enumerate all performance metrics counter paths that supported by the runtime.

public static int
xrGetPerformanceMetricsStateMETA(XrSession
an XrSession handle previously created with CreateSession.
session
,
XrPerformanceMetricsStateMETA
a pointer to an XrPerformanceMetricsStateMETA structure.
state
)

Get current state of performance metrics.

public static int
xrQueryPerformanceMetricsCounterMETA(XrSession
an XrSession handle previously created with CreateSession.
session
,
long
a valid performance metrics counter path.
counterPath
,
XrPerformanceMetricsCounterMETA
a pointer to an XrPerformanceMetricsCounterMETA structure.
counter
)

Query performance metrics counter.

public static int
xrSetPerformanceMetricsStateMETA(XrSession
an XrSession handle previously created with CreateSession.
session
,
XrPerformanceMetricsStateMETA
a pointer to an XrPerformanceMetricsStateMETA structure.
state
)

Enable/disable performance metrics.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_META_PERFORMANCE_METRICS_EXTENSION_NAMEback to summary
public static final String XR_META_PERFORMANCE_METRICS_EXTENSION_NAME

The extension name.

XR_META_performance_metrics_SPEC_VERSIONback to summary
public static final int XR_META_performance_metrics_SPEC_VERSION

The extension specification version.

XR_PERFORMANCE_METRICS_COUNTER_ANY_VALUE_VALID_BIT_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_ANY_VALUE_VALID_BIT_META

XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA

Flag Descriptions
XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_FLOAT_VALUE_VALID_BIT_META

XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA

Flag Descriptions
XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_UINT_VALUE_VALID_BIT_META

XrPerformanceMetricsCounterFlagBitsMETA - XrPerformanceMetricsCounterFlagBitsMETA

Flag Descriptions
XR_PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA

Description
EnumDescription
PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_METAthe performance counter unit is percentage (%).
PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_METAthe performance counter unit is millisecond.
PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_METAthe performance counter unit is byte.
PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_METAthe performance counter unit is hertz (Hz).
See Also

XrPerformanceMetricsCounterMETA

XR_PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA

Description
EnumDescription
PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_METAthe performance counter unit is percentage (%).
PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_METAthe performance counter unit is millisecond.
PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_METAthe performance counter unit is byte.
PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_METAthe performance counter unit is hertz (Hz).
See Also

XrPerformanceMetricsCounterMETA

XR_PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA

Description
EnumDescription
PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_METAthe performance counter unit is percentage (%).
PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_METAthe performance counter unit is millisecond.
PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_METAthe performance counter unit is byte.
PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_METAthe performance counter unit is hertz (Hz).
See Also

XrPerformanceMetricsCounterMETA

XR_PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA

Description
EnumDescription
PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_METAthe performance counter unit is percentage (%).
PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_METAthe performance counter unit is millisecond.
PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_METAthe performance counter unit is byte.
PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_METAthe performance counter unit is hertz (Hz).
See Also

XrPerformanceMetricsCounterMETA

XR_PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_METAback to summary
public static final int XR_PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_META

XrPerformanceMetricsCounterUnitMETA - XrPerformanceMetricsCounterUnitMETA

Description
EnumDescription
PERFORMANCE_METRICS_COUNTER_UNIT_GENERIC_METAthe performance counter unit is generic (unspecified).
PERFORMANCE_METRICS_COUNTER_UNIT_PERCENTAGE_METAthe performance counter unit is percentage (%).
PERFORMANCE_METRICS_COUNTER_UNIT_MILLISECONDS_METAthe performance counter unit is millisecond.
PERFORMANCE_METRICS_COUNTER_UNIT_BYTES_METAthe performance counter unit is byte.
PERFORMANCE_METRICS_COUNTER_UNIT_HERTZ_METAthe performance counter unit is hertz (Hz).
See Also

XrPerformanceMetricsCounterMETA

XR_TYPE_PERFORMANCE_METRICS_COUNTER_METAback to summary
public static final int XR_TYPE_PERFORMANCE_METRICS_COUNTER_META

Extends XrStructureType.

Enum values:
XR_TYPE_PERFORMANCE_METRICS_STATE_METAback to summary
public static final int XR_TYPE_PERFORMANCE_METRICS_STATE_META

Extends XrStructureType.

Enum values:

Constructor Detail

METAPerformanceMetricsback to summary
protected METAPerformanceMetrics()

Method Detail

nxrEnumeratePerformanceMetricsCounterPathsMETAback to summary
public static int nxrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance instance, int counterPathCapacityInput, long counterPathCountOutput, long counterPaths)

Unsafe version of: EnumeratePerformanceMetricsCounterPathsMETA

Parameters
counterPathCapacityInput:int

the capacity of the counterPaths array, or 0 to indicate a request to retrieve the required capacity.

nxrGetPerformanceMetricsStateMETAback to summary
public static int nxrGetPerformanceMetricsStateMETA(XrSession session, long state)

Unsafe version of: GetPerformanceMetricsStateMETA

nxrQueryPerformanceMetricsCounterMETAback to summary
public static int nxrQueryPerformanceMetricsCounterMETA(XrSession session, long counterPath, long counter)

Unsafe version of: QueryPerformanceMetricsCounterMETA

nxrSetPerformanceMetricsStateMETAback to summary
public static int nxrSetPerformanceMetricsStateMETA(XrSession session, long state)

Unsafe version of: SetPerformanceMetricsStateMETA

xrEnumeratePerformanceMetricsCounterPathsMETAback to summary
public static int xrEnumeratePerformanceMetricsCounterPathsMETA(XrInstance instance, IntBuffer counterPathCountOutput, LongBuffer counterPaths)

Enumerate all performance metrics counter paths that supported by the runtime.

C Specification

The EnumeratePerformanceMetricsCounterPathsMETA function enumerates all performance metrics counter paths that supported by the runtime, it is defined as:


XrResult xrEnumeratePerformanceMetricsCounterPathsMETA(
    XrInstance                                  instance,
    uint32_t                                    counterPathCapacityInput,
    uint32_t*                                   counterPathCountOutput,
    XrPath*                                     counterPaths);
Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
Parameters
instance:XrInstance

an XrInstance handle previously created with CreateInstance.

counterPathCountOutput:IntBuffer

filled in by the runtime with the count of counterPaths written or the required capacity in the case that counterPathCapacityInput is insufficient.

counterPaths:LongBuffer

an array of XrPath filled in by the runtime which contains all the available performance metrics counters, but can be NULL if counterPathCapacityInput is 0.

Annotations
@NativeType:XrResult
xrGetPerformanceMetricsStateMETAback to summary
public static int xrGetPerformanceMetricsStateMETA(XrSession session, XrPerformanceMetricsStateMETA state)

Get current state of performance metrics.

C Specification

The GetPerformanceMetricsStateMETA function is defined as:


XrResult xrGetPerformanceMetricsStateMETA(
    XrSession                                   session,
    XrPerformanceMetricsStateMETA*              state);
Description

The GetPerformanceMetricsStateMETA function gets the current state of the performance metrics system.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrPerformanceMetricsStateMETA, SetPerformanceMetricsStateMETA

Parameters
session:XrSession

an XrSession handle previously created with CreateSession.

state:XrPerformanceMetricsStateMETA

a pointer to an XrPerformanceMetricsStateMETA structure.

Annotations
@NativeType:XrResult
xrQueryPerformanceMetricsCounterMETAback to summary
public static int xrQueryPerformanceMetricsCounterMETA(XrSession session, long counterPath, XrPerformanceMetricsCounterMETA counter)

Query performance metrics counter.

C Specification

The QueryPerformanceMetricsCounterMETA function is defined as:


XrResult xrQueryPerformanceMetricsCounterMETA(
    XrSession                                   session,
    XrPath                                      counterPath,
    XrPerformanceMetricsCounterMETA*            counter);
Description

The QueryPerformanceMetricsCounterMETA function queries a performance metrics counter.

The application should enable the performance metrics system (by calling SetPerformanceMetricsStateMETA) before querying metrics using QueryPerformanceMetricsCounterMETA. If the performance metrics system has not been enabled before calling QueryPerformanceMetricsCounterMETA, the runtime must return ERROR_VALIDATION_FAILURE.

If counterPath is not in the list returned by EnumeratePerformanceMetricsCounterPathsMETA, the runtime must return ERROR_PATH_UNSUPPORTED.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrPerformanceMetricsCounterMETA

Parameters
session:XrSession

an XrSession handle previously created with CreateSession.

counterPath:long

a valid performance metrics counter path.

counter:XrPerformanceMetricsCounterMETA

a pointer to an XrPerformanceMetricsCounterMETA structure.

Annotations
@NativeType:XrResult
xrSetPerformanceMetricsStateMETAback to summary
public static int xrSetPerformanceMetricsStateMETA(XrSession session, XrPerformanceMetricsStateMETA state)

Enable/disable performance metrics.

C Specification

The SetPerformanceMetricsStateMETA function is defined as:


XrResult xrSetPerformanceMetricsStateMETA(
    XrSession                                   session,
    const XrPerformanceMetricsStateMETA*        state);
Description

The SetPerformanceMetricsStateMETA function enables or disables the performance metrics system.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrPerformanceMetricsStateMETA, GetPerformanceMetricsStateMETA

Parameters
session:XrSession

an XrSession handle previously created with CreateSession.

state:XrPerformanceMetricsStateMETA

a pointer to an XrPerformanceMetricsStateMETA structure.

Annotations
@NativeType:XrResult