Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

AdaptivePerformanceStableFrameModeProvider

class in UnityEngine.AdaptivePerformance


Implements interfaces:IAdaptivePerformanceModeProvider

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Mode provider that prioritizes consistent frame time over the highest achievable frame rate.

On mode start the provider reads the AdaptiveFramerate scaler's bounds and pins Time.maximumDeltaTime to 1 / MinBound — a physics-stability clamp so a hitch can never stretch a single physics step past the budget.

The provider then forces vsync off (QualitySettings.vSyncCount to 0) and takes ownership of framerate: vsync's snap-to-refresh-divisor behavior turns a missed deadline into a large frame-time spike, exactly the variance this mode fights. It force-enables the AdaptiveFramerate scaler, starts Application.targetFrameRate at MaxBound, and lets the scaler participate in the indexer's cost-based adjustment so the framerate seeks the highest stably-reachable rate (MinBound is the floor). The original vsync count, framerate, and maximum delta time are all restored on mode end.

Each frame it produces a performance action and adopts whichever signal asks for the most aggressive change. A headroom guard runs on every frame regardless of vsync: it asks for a decrease when CPU/GPU work climbs toward the presented frame interval, which is one load bump from a dropped frame. Alongside it a variance signal runs, whose source depends on whether presentation is vsync-locked. When it is (mobile always is — its compositor paces frames at the hardware level regardless of QualitySettings.vSyncCount), wall-clock frame time quantizes to the display cadence and its variance goes blind until a frame drops, so the provider measures variance on CPU/GPU work time. When it isn't, wall-clock frame time is authoritative and its variance is measured directly. Both paths also honor the MinBound floor via AdaptivePerformanceStableFrameModeProvider.TargetFrameTimeVarianceMs's companion lower-bound check.

Properties

Property Description
CpuUtilizationAction The action the mode applies in response to the device's CPU utilization data. Always StateAction.Stale because this mode drives scalers from frame-time variance rather than CPU utilization.
GpuUtilizationAction The action the mode applies in response to the device's GPU utilization data. Always StateAction.Stale because this mode drives scalers from frame-time variance rather than GPU utilization.
Indexer The Indexer that this mode adjusts scalers through.
ModeName The name of the operation mode.
PerformanceAction The action the mode applies in response to the device's performance state.
Settings The active Adaptive Performance settings.
TargetFrameTimeVarianceMs Maximum tolerated variance in the mode's frame-cost signal, in ms².
ThermalAction The action the mode applies in response to the device's thermal state.

Public Methods

Method Description
ApplyModeActions Applies stable frame mode's variance, lower-bound, and headroom actions to the active scalers. Adaptive Performance calls this method every frame while stable frame mode is active.
OnOperationModeEnd Called when stable frame mode is replaced by another operation mode. Resets the variance window and restores the framerate bounds it applied.
OnOperationModeStart Called when stable frame mode becomes the active operation mode. Resets the variance window and applies the framerate bounds read from the AdaptiveFramerate scaler.