Class METAPerformanceMetrics

java.lang.Object
org.lwjgl.openxr.METAPerformanceMetrics

public class METAPerformanceMetrics extends Object
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:

  • pathname:/perfmetrics_meta/app/cpu_frametime
  • pathname:/perfmetrics_meta/app/gpu_frametime
  • pathname:/perfmetrics_meta/app/motion_to_photon_latency
  • pathname:/perfmetrics_meta/compositor/cpu_frametime
  • pathname:/perfmetrics_meta/compositor/gpu_frametime
  • pathname:/perfmetrics_meta/compositor/dropped_frame_count
  • pathname:/perfmetrics_meta/compositor/spacewarp_mode
  • pathname:/perfmetrics_meta/device/cpu_utilization_average
  • pathname:/perfmetrics_meta/device/cpu_utilization_worst
  • pathname:/perfmetrics_meta/device/gpu_utilization
  • pathname:/perfmetrics_meta/device/cpu0_utilization through pathname:/perfmetrics_meta/device/cpuX_utilization

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 extension section.