PerformanceFrameHeaderVersion1.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. using System.Runtime.InteropServices;
  2. namespace Ryujinx.Audio.Renderer.Server.Performance
  3. {
  4. /// <summary>
  5. /// Implementation of <see cref="IPerformanceHeader"/> for performance metrics version 1.
  6. /// </summary>
  7. [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x18)]
  8. public struct PerformanceFrameHeaderVersion1 : IPerformanceHeader
  9. {
  10. /// <summary>
  11. /// The magic of the performance header.
  12. /// </summary>
  13. public uint Magic;
  14. /// <summary>
  15. /// The total count of entries in this frame.
  16. /// </summary>
  17. public int EntryCount;
  18. /// <summary>
  19. /// The total count of detailed entries in this frame.
  20. /// </summary>
  21. public int EntryDetailCount;
  22. /// <summary>
  23. /// The offset of the next performance header.
  24. /// </summary>
  25. public int NextOffset;
  26. /// <summary>
  27. /// The total time taken by all the commands profiled.
  28. /// </summary>
  29. public int TotalProcessingTime;
  30. /// <summary>
  31. /// The count of voices that were dropped.
  32. /// </summary>
  33. public uint VoiceDropCount;
  34. public int GetEntryCount()
  35. {
  36. return EntryCount;
  37. }
  38. public int GetEntryCountOffset()
  39. {
  40. return 4;
  41. }
  42. public int GetEntryDetailCount()
  43. {
  44. return EntryDetailCount;
  45. }
  46. public void SetDspRunningBehind(bool isRunningBehind)
  47. {
  48. // NOTE: Not present in version 1
  49. }
  50. public void SetEntryCount(int entryCount)
  51. {
  52. EntryCount = entryCount;
  53. }
  54. public void SetEntryDetailCount(int entryDetailCount)
  55. {
  56. EntryDetailCount = entryDetailCount;
  57. }
  58. public void SetIndex(uint index)
  59. {
  60. // NOTE: Not present in version 1
  61. }
  62. public void SetMagic(uint magic)
  63. {
  64. Magic = magic;
  65. }
  66. public void SetNextOffset(int nextOffset)
  67. {
  68. NextOffset = nextOffset;
  69. }
  70. public void SetStartRenderingTicks(ulong startTicks)
  71. {
  72. // NOTE: not present in version 1
  73. }
  74. public void SetTotalProcessingTime(int totalProcessingTime)
  75. {
  76. TotalProcessingTime = totalProcessingTime;
  77. }
  78. public void SetVoiceDropCount(uint voiceCount)
  79. {
  80. VoiceDropCount = voiceCount;
  81. }
  82. }
  83. }