PerformanceEntryVersion1.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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="IPerformanceEntry"/> for performance metrics version 1.
  7. /// </summary>
  8. [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
  9. public struct PerformanceEntryVersion1 : IPerformanceEntry
  10. {
  11. /// <summary>
  12. /// The node id associated to this entry.
  13. /// </summary>
  14. public int NodeId;
  15. /// <summary>
  16. /// The start time (in microseconds) associated to this entry.
  17. /// </summary>
  18. public int StartTime;
  19. /// <summary>
  20. /// The processing time (in microseconds) associated to this entry.
  21. /// </summary>
  22. public int ProcessingTime;
  23. /// <summary>
  24. /// The entry type associated to this entry.
  25. /// </summary>
  26. public PerformanceEntryType EntryType;
  27. public int GetProcessingTime()
  28. {
  29. return ProcessingTime;
  30. }
  31. public int GetProcessingTimeOffset()
  32. {
  33. return 8;
  34. }
  35. public int GetStartTime()
  36. {
  37. return StartTime;
  38. }
  39. public int GetStartTimeOffset()
  40. {
  41. return 4;
  42. }
  43. public void SetEntryType(PerformanceEntryType type)
  44. {
  45. EntryType = type;
  46. }
  47. public void SetNodeId(int nodeId)
  48. {
  49. NodeId = nodeId;
  50. }
  51. }
  52. }