Beispiel #1
0
        // SetPerformanceConfiguration(nn::apm::PerformanceMode, nn::apm::PerformanceConfiguration)
        public ResultCode SetPerformanceConfiguration(ServiceCtx context)
        {
            PerformanceMode          performanceMode          = (PerformanceMode)context.RequestData.ReadInt32();
            PerformanceConfiguration performanceConfiguration = (PerformanceConfiguration)context.RequestData.ReadInt32();

            return(SetPerformanceConfiguration(performanceMode, performanceConfiguration));
        }
Beispiel #2
0
        public long SetPerformanceConfiguration(ServiceCtx context)
        {
            PerformanceMode          perfMode   = (PerformanceMode)context.RequestData.ReadInt32();
            PerformanceConfiguration perfConfig = (PerformanceConfiguration)context.RequestData.ReadInt32();

            return(0);
        }
        public static void Update <T>(PerformanceMode performanceMode, string performanceKey, T value, Delegate func, params object[] args)
        {
            switch (performanceMode)
            {
            case PerformanceMode.ApplicationState:
                ApplicationStateHelper.SetOrUpdate <T>(performanceKey, value);
                break;

            case PerformanceMode.Cache:
                CacheHelper.SetOrUpdate <T>(performanceKey, value);
                break;

            //case PerformanceMode.MemoryCache:
            //    MemoryCacheHelper.SetOrUpdate<T>(performanceKey, value);
            //    break;
            case PerformanceMode.Session:
                SessionHelper.SetOrUpdate <T>(performanceKey, value);
                break;

            //  case PerformanceMode.Redis:
            //  return RedisCacheHelper.Change<T>(performanceKey, value);
            //  break;
            case PerformanceMode.None:
                func.DynamicInvoke(args);
                break;
            }
        }
Beispiel #4
0
        public long GetPerformanceConfiguration(ServiceCtx Context)
        {
            PerformanceMode PerfMode = (PerformanceMode)Context.RequestData.ReadInt32();

            Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);

            return(0);
        }
Beispiel #5
0
 public PerformanceConfiguration GetCurrentPerformanceConfiguration(PerformanceMode performanceMode)
 {
     return(performanceMode switch
     {
         PerformanceMode.Default => DefaultPerformanceConfiguration,
         PerformanceMode.Boost => BoostPerformanceConfiguration,
         _ => PerformanceConfiguration.PerformanceConfiguration7
     });
Beispiel #6
0
        public long GetPerformanceConfiguration(ServiceCtx Context)
        {
            PerformanceMode PerfMode = (PerformanceMode)Context.RequestData.ReadInt32();

            Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);

            Context.Device.Log.PrintStub(LogClass.ServiceApm, "Stubbed.");

            return(0);
        }
Beispiel #7
0
        public static void SetKeywordValue(string name, string value, PerformanceMode performanceMode)
        {
            var performanceKey = uniqueKey + name;

            Func <string, string, bool> fnc = SetKeywordValueToSettings;

            var args = new object[] { name, value };

            PerformanceHelper.Update <string>(performanceMode, performanceKey, value, fnc, args);
        }
Beispiel #8
0
        public long GetPerformanceConfiguration(ServiceCtx context)
        {
            PerformanceMode perfMode = (PerformanceMode)context.RequestData.ReadInt32();

            context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);

            Logger.PrintStub(LogClass.ServiceApm);

            return(0);
        }
        // GetPerformanceMode() -> u32
        public ResultCode GetPerformanceMode(ServiceCtx context)
        {
            PerformanceMode mode = context.Device.System.State.DockedMode
                ? PerformanceMode.Docked
                : PerformanceMode.Handheld;

            context.ResponseData.Write((int)mode);

            return(ResultCode.Success);
        }
Beispiel #10
0
        // GetPerformanceConfiguration(nn::apm::PerformanceMode) -> nn::apm::PerformanceConfiguration
        public ResultCode GetPerformanceConfiguration(ServiceCtx context)
        {
            PerformanceMode performanceMode = (PerformanceMode)context.RequestData.ReadInt32();

            ResultCode resultCode = GetPerformanceConfiguration(performanceMode, out PerformanceConfiguration performanceConfiguration);

            context.ResponseData.Write((uint)performanceConfiguration);

            return(resultCode);
        }
Beispiel #11
0
        public long GetPerformanceConfiguration(ServiceCtx Context)
        {
            PerformanceMode PerfMode = (PerformanceMode)Context.RequestData.ReadInt32();

            Context.ResponseData.Write((uint)PerformanceConfiguration.PerformanceConfiguration1);

            Logging.Stub(LogClass.ServiceApm, $"PerformanceMode = {PerfMode}, PerformanceConfiguration =" +
                         $" {PerformanceConfiguration.PerformanceConfiguration1}");

            return(0);
        }
Beispiel #12
0
 private void Start()
 {
     titleControll   = GameObject.Find("TitleMainCamera").GetComponent <TitleCameraMove>();
     title_frag      = true;
     gun_frag        = true;
     Title_time      = 0;
     light_time      = 0;
     horizonValue    = 0;
     Count           = 0;
     performanceMode = PerformanceMode.Title;
 }
Beispiel #13
0
        public static List <Language> GetLanguages(PerformanceMode performanceMode)
        {
            var keyValue = new List <Language>();

            Func <List <Language> > fnc = GetLanguagesFromSettings;

            var args = (object[])null;

            PerformanceHelper.GetPerformance(performanceMode, languagesUniqueKey, out keyValue, fnc, args);

            return(keyValue);
        }
 public override void DrawFeatureGUI(Material mat)
 {
     perfMode           = (PerformanceMode)EditorGUILayout.EnumPopup(CShaderPerfMode, perfMode);
     maxTextureCount    = (MaxTextureCount)EditorGUILayout.EnumPopup(CMaxTexCount, maxTextureCount);
     lightingMode       = (LightingMode)EditorGUILayout.EnumPopup(CLightingMode, lightingMode);
     uvMode             = (UVMode)EditorGUILayout.EnumPopup(CUVMode, uvMode);
     shaderModel        = (ShaderModel)EditorGUILayout.EnumPopup(CForceShaderModel, shaderModel);
     samplerMode        = (SamplerMode)EditorGUILayout.EnumPopup(CSamplerMode, samplerMode);
     emissiveArray      = EditorGUILayout.Toggle(CEmissiveArray, emissiveArray);
     disableHeightBlend = EditorGUILayout.Toggle(CDisableHeightBlend, disableHeightBlend);
     //debugOutput = (DebugOutput)EditorGUILayout.EnumPopup("Debug", debugOutput);
 }
Beispiel #15
0
        public static string GetExpression(string name, PerformanceMode performanceMode)
        {
            var keyValue       = string.Empty;
            var performanceKey = expressionUniqueKey + name;

            Func <string, string> fnc = GetExpressionFromSettings;

            var args = new object[] { name };

            PerformanceHelper.GetPerformance <string>(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #16
0
        public static PageCache GetCache(string id, PerformanceMode performanceMode)
        {
            var keyValue       = new PageCache();
            var performanceKey = uniqueKey + id;

            var fnc = new Func <string, PageCache>(GetCacheFromSettings);

            object[] args = { id };

            PerformanceHelper.GetPerformance <PageCache>(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #17
0
        public static bool LanguageExists(string locale, PerformanceMode performanceMode)
        {
            var keyValue       = false;
            var performanceKey = $"{uniqueKey}_{locale}_LanguageExistance";

            Func <string, bool> fnc = LanguageExistsFromSettings;

            var args = new object[] { locale };

            PerformanceHelper.GetPerformance(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #18
0
        public static string GetLocaleDirection(string locale, PerformanceMode performanceMode)
        {
            var keyValue       = "ltr";
            var performanceKey = $"{uniqueKey}_{locale}_LocaleDirection";

            Func <string, string> fnc = GetLocaleDirectionFromSettings;

            var args = new object[] { locale };

            PerformanceHelper.GetPerformance(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #19
0
        public static string GetMessage(string name, string locale, PerformanceMode performanceMode)
        {
            var keyValue       = string.Empty;
            var performanceKey = string.Format("{0}{1}_{2}", messageUniqueKey, name, locale);

            Func <string, string, string> fnc = GetMessageFromSettings;

            var args = new object[] { name, locale };

            PerformanceHelper.GetPerformance <string>(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #20
0
        public static bool MessageExists(string name, string locale, PerformanceMode performanceMode)
        {
            var keyValue       = false;
            var performanceKey = string.Format("{0}{1}_{2}_MessageExistance", messageUniqueKey, name, locale);

            Func <string, string, bool> fnc = MessageExistsFromSettings;

            var args = new object[] { name, locale };

            PerformanceHelper.GetPerformance <bool>(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
        public static SEO GetPageSEO(string id, PerformanceMode performanceMode)
        {
            var keyValue       = new SEO();
            var performanceKey = $"{uniqueKey}_{id}";

            Func <string, SEO> fnc = GetPageSEOFromSettings;

            var args = new object[] { id };

            PerformanceHelper.GetPerformance <SEO>(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #22
0
        protected override ResultCode GetPerformanceConfiguration(PerformanceMode performanceMode, out PerformanceConfiguration performanceConfiguration)
        {
            if (performanceMode > PerformanceMode.Boost)
            {
                performanceConfiguration = 0;

                return(ResultCode.InvalidParameters);
            }

            performanceConfiguration = _context.Device.System.PerformanceState.GetCurrentPerformanceConfiguration(performanceMode);

            return(ResultCode.Success);
        }
Beispiel #23
0
        public static ServerSettings GetServer(string name, PerformanceMode performanceMode)
        {
            var keyValue = new ServerSettings();

            var performanceKey = uniqueKey + name;

            Func <string, ServerSettings> fnc = GetServerFromSettings;

            var args = new object[] { name };

            PerformanceHelper.GetPerformance(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #24
0
        public static string GetKey(string name, string locale, PerformanceMode performanceMode)
        {
            var keyValue = $"KEY_[{name}]_UNDEFINED";

            var performanceKey = $"{uniqueKey}{name}_{locale}";

            Func <string, string, string> fnc = GetKeyFromSettings;

            var args = new object[] { name, locale };

            PerformanceHelper.GetPerformance(performanceMode, performanceKey, out keyValue, fnc, args);

            return(keyValue);
        }
Beispiel #25
0
        private void PopulateSeries(Func <double, double> f, double x0, double x1, PerformanceMode mode)
        {
            var x            = x0;
            var dx           = (x1 - x0) / (int)mode;
            var y            = f(x);
            var isOutOfBound = double.IsInfinity(y) || double.IsNaN(y);

            for (var i = 0; i < (int)mode + 1; i++)
            {
                y = f(x);

                if (!isOutOfBound)
                {
                    if (y < x0)
                    {
                        isOutOfBound = true;
                        Points.Add(new DataPoint(x, x0));
                        Points.Add(DataPoint.Undefined);
                    }
                    else if (y > x1)
                    {
                        isOutOfBound = true;
                        Points.Add(new DataPoint(x, x1));
                        Points.Add(DataPoint.Undefined);
                    }
                    else if (i % ((int)mode / 100000) == 0)
                    {
                        Points.Add(new DataPoint(x, y));
                    }
                }
                else
                {
                    if (y >= x0 && y <= x1 && Math.Abs(y - x0) < Math.Abs(y - x1))
                    {
                        isOutOfBound = false;
                        Points.Add(new DataPoint(x, x0));
                    }
                    if (y >= x0 && y <= x1 && Math.Abs(y - x0) > Math.Abs(y - x1))
                    {
                        isOutOfBound = false;
                        Points.Add(new DataPoint(x, x1));
                    }
                }

                x += dx;
            }
        }
Beispiel #26
0
        public override void DrawFeatureGUI(Material mat)
        {
            bool isSurfaceShader = mat.IsKeywordEnabled("_MSRENDERLOOP_SURFACESHADER");

            perfMode        = (PerformanceMode)EditorGUILayout.EnumPopup(CShaderPerfMode, perfMode);
            maxTextureCount = (MaxTextureCount)EditorGUILayout.EnumPopup(CMaxTexCount, maxTextureCount);
            if (isSurfaceShader)
            {
                lightingMode = (LightingMode)EditorGUILayout.EnumPopup(CLightingMode, lightingMode);
            }
            uvMode             = (UVMode)EditorGUILayout.EnumPopup(CUVMode, uvMode);
            shaderModel        = (ShaderModel)EditorGUILayout.EnumPopup(CForceShaderModel, shaderModel);
            samplerMode        = (SamplerMode)EditorGUILayout.EnumPopup(CSamplerMode, samplerMode);
            emissiveArray      = EditorGUILayout.Toggle(CEmissiveArray, emissiveArray);
            disableHeightBlend = EditorGUILayout.Toggle(CDisableHeightBlend, disableHeightBlend);
            //debugOutput = (DebugOutput)EditorGUILayout.EnumPopup("Debug", debugOutput);
        }
Beispiel #27
0
        internal static void UpdatePerformanceMode()
        {
            // MODES
            // Show the warning about safe mode, if the player disables safe mode and is not in main menu.
            bool dontUpdate = false;

            if (ModLoader.CurrentScene != CurrentScene.MainMenu && IsModActive)
            {
                if (Mode == PerformanceMode.Safe && MOP.PerformanceModes.Value != 3)
                {
                    ModPrompt.CreatePrompt("Safe Mode will be disabled after the restart.", "MOP");
                    dontUpdate = true;
                }
                else if (Mode != PerformanceMode.Safe && MOP.PerformanceModes.Value == 3)
                {
                    ModPrompt.CreatePrompt("Safe Mode will be enabled after the restart.", "MOP");
                    dontUpdate = true;
                }

                if (!dontUpdate)
                {
                    switch (MOP.PerformanceModes.Value)
                    {
                    default:
                        Mode = PerformanceMode.Balanced;
                        break;

                    case 0:
                        Mode = PerformanceMode.Performance;
                        break;

                    case 1:
                        Mode = PerformanceMode.Balanced;
                        break;

                    case 2:
                        Mode = PerformanceMode.Quality;
                        break;

                    case 3:
                        Mode = PerformanceMode.Safe;
                        break;
                    }
                }
            }
        }
        public static void ClearPerformance(string performanceKey, PerformanceMode performanceMode)
        {
            switch (performanceMode)
            {
            case PerformanceMode.ApplicationState:
                if (ApplicationStateHelper.Exists(performanceKey))
                {
                    ApplicationStateHelper.Clear(performanceKey);
                }
                break;

            case PerformanceMode.Cache:
                if (CacheHelper.Exists(performanceKey))
                {
                    CacheHelper.Clear(performanceKey);
                }
                break;

            //case PerformanceMode.MemoryCache:
            //    if (MemoryCacheHelper.Exists(performanceKey))
            //    {
            //        MemoryCacheHelper.Clear(performanceKey);
            //    }
            //    break;

            case PerformanceMode.Session:
                if (SessionHelper.Exists(performanceKey))
                {
                    SessionHelper.Clear(performanceKey);
                }
                break;

            case PerformanceMode.Redis:
            //if (RedisCacheHelper.Exists(performanceKey))
            //{
            //    RedisCacheHelper.Clear(performanceKey);
            //}
            //break;

            case PerformanceMode.None:
                break;
            }
        }
      public override void DrawFeatureGUI(MicroSplatKeywords keywords)
      {
         bool isSurfaceShader = keywords.IsKeywordEnabled("_MSRENDERLOOP_SURFACESHADER");
         packMode = (TextureArrayConfig.PackingMode)EditorGUILayout.EnumPopup(CPackMode, packMode);
         perfMode = (PerformanceMode)EditorGUILayout.EnumPopup(CShaderPerfMode, perfMode);
         maxTextureCount = (MaxTextureCount)EditorGUILayout.EnumPopup(CMaxTexCount, maxTextureCount);
         if (isSurfaceShader)
         {
            lightingMode = (LightingMode)EditorGUILayout.EnumPopup(CLightingMode, lightingMode);
         }
         uvMode = (UVMode)EditorGUILayout.EnumPopup(CUVMode, uvMode);
         shaderModel = (ShaderModel)EditorGUILayout.EnumPopup(CForceShaderModel, shaderModel);
         samplerMode = (SamplerMode)EditorGUILayout.EnumPopup(CSamplerMode, samplerMode);
         emissiveArray = EditorGUILayout.Toggle(CEmissiveArray, emissiveArray);
         perPixelNormal = EditorGUILayout.Toggle(CPerPixelNormal, perPixelNormal);
         disableHeightBlend = EditorGUILayout.Toggle(CDisableHeightBlend, disableHeightBlend);
         disableNormals = EditorGUILayout.Toggle(CDisableNormals, disableNormals);
         useCustomSplatMaps = EditorGUILayout.Toggle(CUseCustomSplatMaps, useCustomSplatMaps);

         debugOutput = (DebugOutput)EditorGUILayout.EnumPopup("Debug", debugOutput);
      }
Beispiel #30
0
        protected override ResultCode SetPerformanceConfiguration(PerformanceMode performanceMode, PerformanceConfiguration performanceConfiguration)
        {
            if (performanceMode > PerformanceMode.Boost)
            {
                return(ResultCode.InvalidParameters);
            }

            switch (performanceMode)
            {
            case PerformanceMode.Default:
                _context.Device.System.PerformanceState.DefaultPerformanceConfiguration = performanceConfiguration;
                break;

            case PerformanceMode.Boost:
                _context.Device.System.PerformanceState.BoostPerformanceConfiguration = performanceConfiguration;
                break;

            default:
                Logger.Error?.Print(LogClass.ServiceApm, $"PerformanceMode isn't supported: {performanceMode}");
                break;
            }

            return(ResultCode.Success);
        }