mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-10-01 12:30:00 +02:00
audren: implement Renderer Info output informations (#1179)
This implement the rendering information output informations of RequestUpdate. This is needed by some games to keep track of the count of update on the DSP.
This commit is contained in:
parent
c2ac45adc5
commit
23170da5a0
3 changed files with 34 additions and 0 deletions
|
@ -40,6 +40,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
|||
|
||||
private PlayState _playState;
|
||||
|
||||
private ulong _elapsedFrameCount;
|
||||
|
||||
public IAudioRenderer(
|
||||
Horizon system,
|
||||
MemoryManager memory,
|
||||
|
@ -63,6 +65,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
|||
|
||||
_effects = CreateArray<EffectContext>(rendererParams.EffectCount);
|
||||
|
||||
_elapsedFrameCount = 0;
|
||||
|
||||
InitializeAudioOut();
|
||||
|
||||
_playState = PlayState.Stopped;
|
||||
|
@ -264,6 +268,18 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
|||
writer.Write(effect.OutStatus);
|
||||
}
|
||||
|
||||
writer.SkipBytes(_params.SinkCount * 0x20);
|
||||
writer.SkipBytes(outputHeader.PerformanceManagerSize);
|
||||
writer.SkipBytes(outputHeader.BehaviorSize);
|
||||
|
||||
if (behaviorInfo.IsElapsedFrameCountSupported())
|
||||
{
|
||||
writer.Write(new RendererInfoOut
|
||||
{
|
||||
ElapsedFrameCount = _elapsedFrameCount
|
||||
});
|
||||
}
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
|
@ -331,6 +347,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
|||
{
|
||||
AppendMixedBuffer(released[index]);
|
||||
}
|
||||
|
||||
_elapsedFrameCount++;
|
||||
}
|
||||
|
||||
private void AppendMixedBuffer(long tag)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Audio.AudioRendererManager
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)]
|
||||
struct RendererInfoOut
|
||||
{
|
||||
public ulong ElapsedFrameCount;
|
||||
public ulong Reserved;
|
||||
}
|
||||
}
|
|
@ -21,5 +21,10 @@ namespace Ryujinx.HLE.Utilities
|
|||
|
||||
Position += Marshal.SizeOf<T>();
|
||||
}
|
||||
|
||||
public void SkipBytes(long count)
|
||||
{
|
||||
Position += count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue