PerformanceDetailVersion2.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using Ryujinx.Audio.Renderer.Common;
  2. using System.Runtime.InteropServices;
  3. namespace Ryujinx.Audio.Renderer.Server.Performance
  4. {
  5. /// <summary>
  6. /// Implementation of <see cref="IPerformanceDetailEntry"/> for performance metrics version 2.
  7. /// </summary>
  8. [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x18)]
  9. public struct PerformanceDetailVersion2 : IPerformanceDetailEntry
  10. {
  11. /// <summary>
  12. /// The node id associated to this detailed entry.
  13. /// </summary>
  14. public int NodeId;
  15. /// <summary>
  16. /// The start time (in microseconds) associated to this detailed entry.
  17. /// </summary>
  18. public int StartTime;
  19. /// <summary>
  20. /// The processing time (in microseconds) associated to this detailed entry.
  21. /// </summary>
  22. public int ProcessingTime;
  23. /// <summary>
  24. /// The detailed entry type associated to this detailed entry.
  25. /// </summary>
  26. public PerformanceDetailType DetailType;
  27. /// <summary>
  28. /// The entry type associated to this detailed entry.
  29. /// </summary>
  30. public PerformanceEntryType EntryType;
  31. public int GetProcessingTime()
  32. {
  33. return ProcessingTime;
  34. }
  35. public int GetProcessingTimeOffset()
  36. {
  37. return 8;
  38. }
  39. public int GetStartTime()
  40. {
  41. return StartTime;
  42. }
  43. public int GetStartTimeOffset()
  44. {
  45. return 4;
  46. }
  47. public void SetDetailType(PerformanceDetailType detailType)
  48. {
  49. DetailType = detailType;
  50. }
  51. public void SetEntryType(PerformanceEntryType type)
  52. {
  53. EntryType = type;
  54. }
  55. public void SetNodeId(int nodeId)
  56. {
  57. NodeId = nodeId;
  58. }
  59. }
  60. }