Skip to main content

Performance Settings

Performance Settings allows for dialing of CPU and GPU performance and thermal sustainability by sending performance hints to the runtime.

NOTE

Developers should take into account the performance of their specific application and set the appropriate performance settings to ensure stable frame rates.

Usage

The following method lives inside the BaseRuntimeFeature.cs class. Before calling any of these methods, make sure that the BaseRuntimeFeature is valid.

var baseRuntimeFeature = OpenXRSettings.Instance.GetFeature<BaseRuntimeFeature>();
if (baseRuntimeFeature != null)
{
// Use baseRuntimeFeature
}

Set a Performance Level Hint

To set the performance level hit, pass the desired domain and level.

bool SetPerformanceLevelHint(PerfSettingsDomain domain, PerfSettingsLevel level);

Two domains are defined:

  • CPU
  • GPU

Four levels are defined:

  • PowerSavings: Power savings to be prioritized. Consistent frame rendering and low latency are not needed.
  • SustainedLow: Consistent frame rendering within a thermally sustainable range. The runtime is allowed to reduce power and increase latencies.
  • SustainedHigh: Consistent frame rendering is prioritized within a thermally sustainable range.
  • Boost: The runtime is allowed to step up beyond the thermally sustainable range. This level is meant to be used for short-term durations (<30 seconds).
danger

Boost performance settings level is currently not supported!

Example Code

if (baseRuntimeFeature.SetPerformanceLevelHint(PerfSettingsDomain.CPU, PerfSettingsLevel.SustainedHigh))
{
// Execute high or dynamic complexity code on the CPU
}

if (baseRuntimeFeature.SetPerformanceLevelHint(PerfSettingsDomain.GPU, PerfSettingsLevel.SustainedHigh))
{
// Execute high or dynamic complexity code on the GPU
}