Interface IDevicePerformanceLevelControl
The device performance level control lets you change CPU and GPU levels and informs you about the current levels.
Namespace: UnityEngine.AdaptivePerformance.Provider
Syntax
public interface IDevicePerformanceLevelControl
Properties
MaxCpuPerformanceLevel
Maximum supported CPU performance level. This should not change after startup. UnknownPerformanceLevel in case performance levels are not supported. Value in the range of [MinCpuPerformanceLevel, 10].
Declaration
int MaxCpuPerformanceLevel { get; }
Property Value
Type | Description |
---|---|
Int32 | Value in the range of [MinCpuPerformanceLevel, 10] |
MaxGpuPerformanceLevel
Maximum supported GPU performance level. This should not change after startup. UnknownPerformanceLevel in case performance levels are not supported. Value in the range of [MinGpuPerformanceLevel, 10].
Declaration
int MaxGpuPerformanceLevel { get; }
Property Value
Type | Description |
---|---|
Int32 | Value in the range of [MinGpuPerformanceLevel, 10] |
Methods
EnableCpuBoost()
Request a CPU performance boost.
Declaration
bool EnableCpuBoost()
Returns
Type | Description |
---|---|
Boolean | Returns true on success. When this fails, it means that the system took control and does not allow boosts. |
EnableGpuBoost()
Request a GPU performance boost.
Declaration
bool EnableGpuBoost()
Returns
Type | Description |
---|---|
Boolean | Returns true on success. When this fails, it means that the system took control and does not allow boosts. |
SetPerformanceLevel(ref Int32, ref Int32)
Request a performance level change. If UnknownPerformanceLevel is passed, the subsystem picks the level to be used.
Declaration
bool SetPerformanceLevel(ref int cpu, ref int gpu)
Parameters
Type | Name | Description |
---|---|---|
Int32 | cpu | The new performance level. Can be UnknownPerformanceLevel or range of [MinCpuPerformanceLevel, MaxCpuPerformanceLevel]. If CpuPerformanceLevel is not supported (see Capabilities), this parameter is ignored. |
Int32 | gpu | The new performance level. Can be UnknownPerformanceLevel or range of [MinCpuPerformanceLevel, MaxGpuPerformanceLevel]. If GpuPerformanceLevel is not supported (see Capabilities), this parameter is ignored. |
Returns
Type | Description |
---|---|
Boolean | Returns true on success. When this fails, it means that the system took control of the active performance levels. |