Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AdaptivePerformanceProfilerModule.cs 1.6KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using Unity.Profiling;
  3. using Unity.Profiling.Editor;
  4. namespace UnityEditor.AdaptivePerformance.Editor
  5. {
  6. [Serializable]
  7. [ProfilerModuleMetadata("Adaptive Performance")]
  8. internal class AdaptivePerformanceProfilerModule : ProfilerModule
  9. {
  10. static readonly ProfilerCounterDescriptor[] k_ChartCounters = new ProfilerCounterDescriptor[]
  11. {
  12. new ProfilerCounterDescriptor("CPU frametime", ProfilerCategory.Scripts),
  13. new ProfilerCounterDescriptor("GPU frametime", ProfilerCategory.Scripts),
  14. new ProfilerCounterDescriptor("CPU performance level", ProfilerCategory.Scripts),
  15. new ProfilerCounterDescriptor("GPU performance level", ProfilerCategory.Scripts),
  16. new ProfilerCounterDescriptor("Frametime", ProfilerCategory.Scripts),
  17. new ProfilerCounterDescriptor("Temperature Level", ProfilerCategory.Scripts),
  18. new ProfilerCounterDescriptor("Temperature Trend", ProfilerCategory.Scripts),
  19. };
  20. // Specify a list of Profiler category names, which should be auto-enabled when the module is active.
  21. static readonly string[] k_AutoEnabledCategoryNames = new string[]
  22. {
  23. AdaptivePerformanceProfilerStats.AdaptivePerformanceProfilerCategory.Name,
  24. };
  25. public override ProfilerModuleViewController CreateDetailsViewController()
  26. {
  27. return new AdaptivePerformanceDetailsViewController(ProfilerWindow);
  28. }
  29. public AdaptivePerformanceProfilerModule() : base(k_ChartCounters, ProfilerModuleChartType.Line, k_AutoEnabledCategoryNames) {}
  30. }
  31. }