public SamsungGameSDKAdaptivePerformanceSubsystem() { m_Api = new NativeApi(OnPerformanceWarning, OnPerformanceLevelTimeout); m_AsyncUpdater = new AsyncUpdater(); m_SkinTemp = new AsyncValue <int>(m_AsyncUpdater, -1, 2.7f, () => m_Api.GetSkinTempLevel()); m_PSTLevel = new AsyncValue <int>(m_AsyncUpdater, -1, 3.3f, () => m_Api.GetPSTLevel()); m_GPUTime = new AsyncValue <double>(m_AsyncUpdater, -1.0, 0.0f, () => m_Api.GetGpuFrameTime()); Capabilities = Feature.CpuPerformanceLevel | Feature.GpuPerformanceLevel | Feature.PerformanceLevelControl | Feature.TemperatureLevel | Feature.WarningLevel | Feature.GpuFrameTime; m_MainTemperature = m_SkinTemp; m_AsyncUpdater.Start(); }
override public void Start() { if (m_Api.Initialize()) { if (TryParseVersion(m_Api.GetVersion(), out m_Version)) { if (m_Version >= new Version(3, 0)) { initialized = true; m_UseHighPrecisionSkinTemp = true; MaxCpuPerformanceLevel = m_Api.GetMaxCpuPerformanceLevel(); MaxGpuPerformanceLevel = m_Api.GetMaxGpuPerformanceLevel(); GameSDKLog.Debug("MaxCpuPerformanceLevel: " + MaxCpuPerformanceLevel + " MaxGpuPerformanceLevel:" + MaxGpuPerformanceLevel); m_MainTemperature = m_SkinTemp; } else if (m_Version >= new Version(2, 0)) { initialized = true; m_UseHighPrecisionSkinTemp = true; } else if (m_Version >= new Version(1, 6)) { initialized = true; m_UseHighPrecisionSkinTemp = false; } else if (m_Version >= new Version(1, 5)) { m_MaxTempLevel = 6.0f; m_MinTempLevel = 0.0f; initialized = true; m_MainTemperature = m_PSTLevel; m_SkinTemp = null; m_UseHighPrecisionSkinTemp = false; } else { m_Api.Terminate(); initialized = false; } } m_Data.PerformanceLevelControlAvailable = true; } if (initialized) { ImmediateUpdateTemperature(); } }
override public void Start() { if (m_Api.Initialize()) { if (TryParseVersion(m_Api.GetVersion(), out m_Version)) { if (m_Version >= new Version(1, 6)) { m_MaxTempLevel = 7; m_MinTempLevel = 0; initialized = true; m_MainTemperature = m_SkinTemp; } else if (m_Version >= new Version(1, 5)) { m_MaxTempLevel = 6; m_MinTempLevel = 0; initialized = true; m_MainTemperature = m_PSTLevel; m_SkinTemp = null; } else { m_Api.Terminate(); initialized = false; } } m_Data.PerformanceLevelControlAvailable = true; } if (initialized) { ImmediateUpdateTemperature(); } }
override public void Start() { if (m_Api.Initialize()) { if (TryParseVersion(m_Api.GetVersion(), out m_Version)) { if (m_Version >= new Version(3, 2)) { m_MaxTempLevel = 10.0f; m_MinTempLevel = 0.0f; initialized = true; m_UseHighPrecisionSkinTemp = true; MaxCpuPerformanceLevel = m_Api.GetMaxCpuPerformanceLevel(); MaxGpuPerformanceLevel = m_Api.GetMaxGpuPerformanceLevel(); m_MainTemperature = m_SkinTemp; m_UseSetFreqLevels = true; } else if (m_Version >= new Version(3, 0)) { initialized = true; m_UseHighPrecisionSkinTemp = true; MaxCpuPerformanceLevel = m_Api.GetMaxCpuPerformanceLevel(); MaxGpuPerformanceLevel = m_Api.GetMaxGpuPerformanceLevel(); m_MainTemperature = m_SkinTemp; } else if (m_Version >= new Version(2, 0)) { initialized = true; m_UseHighPrecisionSkinTemp = true; } else if (m_Version >= new Version(1, 6)) { initialized = true; m_UseHighPrecisionSkinTemp = false; } else if (m_Version >= new Version(1, 5)) { m_MaxTempLevel = 6.0f; m_MinTempLevel = 0.0f; initialized = true; m_MainTemperature = m_PSTLevel; m_SkinTemp = null; m_UseHighPrecisionSkinTemp = false; } else { m_Api.Terminate(); initialized = false; } } m_Data.PerformanceLevelControlAvailable = true; } if (initialized) { ImmediateUpdateTemperature(); Thread t = new Thread(CheckInitialTemperatureAndSendWarnings); t.Start(); } }