PerformanceManager.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. using Ryujinx.Common.Logging;
  2. namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
  3. {
  4. static class PerformanceManager
  5. {
  6. public static long GetRequiredBufferSizeForPerformanceMetricsPerFrame(BehaviorInfo behaviorInfo, AudioRendererParameter parameters)
  7. {
  8. int performanceMetricsDataFormat = behaviorInfo.GetPerformanceMetricsDataFormat();
  9. if (performanceMetricsDataFormat == 2)
  10. {
  11. return 24 * (parameters.VoiceCount +
  12. parameters.EffectCount +
  13. parameters.SubMixCount +
  14. parameters.SinkCount + 1) + 0x990;
  15. }
  16. if (performanceMetricsDataFormat != 1)
  17. {
  18. Logger.Warning?.Print(LogClass.ServiceAudio, $"PerformanceMetricsDataFormat: {performanceMetricsDataFormat} is not supported!");
  19. }
  20. return (((parameters.VoiceCount +
  21. parameters.EffectCount +
  22. parameters.SubMixCount +
  23. parameters.SinkCount + 1) << 32) >> 0x1C) + 0x658;
  24. }
  25. }
  26. }