IProfilerService.cs 986 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 
  2. namespace SRDebugger.Services
  3. {
  4. using System;
  5. using Profiler;
  6. using SRF.Service;
  7. #if UNITY_2018_1_OR_NEWER
  8. using UnityEngine.Rendering;
  9. using UnityEngine.Experimental.Rendering;
  10. #endif
  11. public static class ProfilerServiceSelector
  12. {
  13. [ServiceSelector(typeof(IProfilerService))]
  14. public static Type GetProfilerServiceType()
  15. {
  16. #if UNITY_2018_1_OR_NEWER
  17. if(GraphicsSettings.defaultRenderPipeline != null)
  18. {
  19. return typeof(SRPProfilerService);
  20. }
  21. #endif
  22. return typeof(ProfilerServiceImpl);
  23. }
  24. }
  25. public struct ProfilerFrame
  26. {
  27. public double FrameTime;
  28. public double OtherTime;
  29. public double RenderTime;
  30. public double UpdateTime;
  31. }
  32. public interface IProfilerService
  33. {
  34. float AverageFrameTime { get; }
  35. float LastFrameTime { get; }
  36. CircularBuffer<ProfilerFrame> FrameBuffer { get; }
  37. }
  38. }