format and comment fixes
This commit is contained in:
parent
ab32c236fa
commit
f229073086
4 changed files with 24 additions and 19 deletions
|
@ -274,7 +274,7 @@ namespace Ryujinx.Audio.Renderer.Server
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the audio renderer should trust the user destination count in <see cref="Renderer.Server.Splitter.SplitterState.Update(Renderer.Server.Splitter.SplitterContext,Renderer.Parameter.SplitterInParameter,SequenceReader{byte})"/>.
|
||||
/// Check if the audio renderer should trust the user destination count in <see cref="Renderer.Server.Splitter.SplitterState.Update(Renderer.Server.Splitter.SplitterContext, Renderer.Parameter.SplitterInParameter, SequenceReader{byte})"/>.
|
||||
/// </summary>
|
||||
/// <returns>True if the audio renderer should trust the user destination count.</returns>
|
||||
public bool IsSplitterBugFixed()
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||
private Memory<SplitterDestination> _splitterDestinations;
|
||||
|
||||
/// <summary>
|
||||
/// If set to true, trust the user destination count in <see cref="SplitterState.Update(SplitterContext,in SplitterInParameter,ref SequenceReader{byte})"/>.
|
||||
/// If set to true, trust the user destination count in <see cref="SplitterState.Update(SplitterContext, in SplitterInParameter, ref SequenceReader{byte})"/>.
|
||||
/// </summary>
|
||||
public bool IsBugFixed { get; private set; }
|
||||
|
||||
|
@ -111,7 +111,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||
/// </summary>
|
||||
/// <param name="splitters">The <see cref="SplitterState"/> storage.</param>
|
||||
/// <param name="splitterDestinations">The <see cref="SplitterDestination"/> storage.</param>
|
||||
/// <param name="isBugFixed">If set to true, trust the user destination count in <see cref="SplitterState.Update(SplitterContext,in SplitterInParameter,ref SequenceReader{byte})"/>.</param>
|
||||
/// <param name="isBugFixed">If set to true, trust the user destination count in <see cref="SplitterState.Update(SplitterContext, in SplitterInParameter, ref SequenceReader{byte})"/>.</param>
|
||||
private void Setup(Memory<SplitterState> splitters, Memory<SplitterDestination> splitterDestinations, bool isBugFixed)
|
||||
{
|
||||
_splitters = splitters;
|
||||
|
@ -153,7 +153,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||
{
|
||||
for (int i = 0; i < inputHeader.SplitterCount; i++)
|
||||
{
|
||||
// NOTE: this Rewind/Advance logic is done here to mimic the behavior of the previous implementation.
|
||||
// NOTE: this Rewind/Advance logic is done here to mimic the behavior of the previous implementation.
|
||||
ref readonly SplitterInParameter parameter = ref input.GetRefOrRefToCopy<SplitterInParameter>(out _);
|
||||
input.Rewind(Unsafe.SizeOf<SplitterInParameter>());
|
||||
|
||||
|
@ -169,13 +169,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||
splitter.Update(this, in parameter, ref input);
|
||||
}
|
||||
|
||||
// NOTE: this historically has been advancing 0xC (12) bytes without explanation. It was hard
|
||||
// to discern as it was combined with the sizeof(SplitterInParameter) (16), == 0x1C (28).
|
||||
|
||||
// NOTE: this historically was also advancing by parameter.DestinationCount * 4, but that was
|
||||
// to account for the reading done by splitter.Update(). Now we pass in `ref input`, so the
|
||||
// reads performed by splitter.Update() are automatically accounted for.
|
||||
|
||||
// NOTE: there are 12 bytes of unused (or unknown?) data after the destination IDs array.
|
||||
input.Advance(0xC);
|
||||
}
|
||||
else
|
||||
|
@ -194,7 +188,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
|
|||
{
|
||||
for (int i = 0; i < inputHeader.SplitterDestinationCount; i++)
|
||||
{
|
||||
// NOTE: this Rewind/Advance logic is done here to mimic the behavior of the previous implementation.
|
||||
// NOTE: this Rewind/Advance logic is done here to mimic the behavior of the previous implementation.
|
||||
ref readonly SplitterDestinationInParameter parameter = ref input.GetRefOrRefToCopy<SplitterDestinationInParameter>(out _);
|
||||
input.Rewind(Unsafe.SizeOf<SplitterDestinationInParameter>());
|
||||
|
||||
|
|
|
@ -426,7 +426,11 @@ namespace Ryujinx.Audio.Renderer.Server.Voice
|
|||
/// <param name="voiceUpdateStates">The voice states associated to the <see cref="VoiceState"/>.</param>
|
||||
/// <param name="mapper">The mapper to use.</param>
|
||||
/// <param name="behaviourContext">The behaviour context.</param>
|
||||
public void UpdateWaveBuffers(out ErrorInfo[] errorInfos, in VoiceInParameter parameter, ReadOnlySpan<Memory<VoiceUpdateState>> voiceUpdateStates, PoolMapper mapper, ref BehaviourContext behaviourContext)
|
||||
public void UpdateWaveBuffers(out ErrorInfo[] errorInfos,
|
||||
in VoiceInParameter parameter,
|
||||
ReadOnlySpan<Memory<VoiceUpdateState>> voiceUpdateStates,
|
||||
PoolMapper mapper,
|
||||
ref BehaviourContext behaviourContext)
|
||||
{
|
||||
errorInfos = new ErrorInfo[Constants.VoiceWaveBufferCount * 2];
|
||||
|
||||
|
@ -458,7 +462,13 @@ namespace Ryujinx.Audio.Renderer.Server.Voice
|
|||
/// <param name="isValid">If set to true, the server side wavebuffer is considered valid.</param>
|
||||
/// <param name="mapper">The mapper to use.</param>
|
||||
/// <param name="behaviourContext">The behaviour context.</param>
|
||||
private void UpdateWaveBuffer(Span<ErrorInfo> errorInfos, ref WaveBuffer waveBuffer, ref WaveBufferInternal inputWaveBuffer, SampleFormat sampleFormat, bool isValid, PoolMapper mapper, ref BehaviourContext behaviourContext)
|
||||
private void UpdateWaveBuffer(Span<ErrorInfo> errorInfos,
|
||||
ref WaveBuffer waveBuffer,
|
||||
ref WaveBufferInternal inputWaveBuffer,
|
||||
SampleFormat sampleFormat,
|
||||
bool isValid,
|
||||
PoolMapper mapper,
|
||||
ref BehaviourContext behaviourContext)
|
||||
{
|
||||
if (!isValid && waveBuffer.IsSendToAudioProcessor && waveBuffer.BufferAddressInfo.CpuAddress != 0)
|
||||
{
|
||||
|
|
|
@ -10,10 +10,10 @@ namespace Ryujinx.Common.Extensions
|
|||
{
|
||||
/// <summary>
|
||||
/// Dumps the entire <see cref="SequenceReader{byte}"/> to a file, restoring its previous location afterward.
|
||||
/// Useful for debugging purposes.
|
||||
/// Useful for debugging purposes.
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="fileFullName"></param>
|
||||
/// <param name="reader">The <see cref="SequenceReader{Byte}"/> to write to a file</param>
|
||||
/// <param name="fileFullName">The path and name of the file to create and dump to</param>
|
||||
public static void DumpToFile(this ref SequenceReader<byte> reader, string fileFullName)
|
||||
{
|
||||
var initialConsumed = reader.Consumed;
|
||||
|
@ -37,7 +37,7 @@ namespace Ryujinx.Common.Extensions
|
|||
/// Returns a reference to the desired value. This ref should always be used. The argument passed in <paramref name="copyDestinationIfRequiredDoNotUse"/> should never be used, as this is only used for storage if the value
|
||||
/// must be copied from multiple <see cref="ReadOnlyMemory{Byte}"/> segments held by the <see cref="SequenceReader{Byte}"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <typeparam name="T">Type to get</typeparam>
|
||||
/// <param name="reader">The <see cref="SequenceReader{Byte}"/> to read from</param>
|
||||
/// <param name="copyDestinationIfRequiredDoNotUse">A location used as storage if (and only if) the value to be read spans multiple <see cref="ReadOnlyMemory{Byte}"/> segments</param>
|
||||
/// <returns>A reference to the desired value, either directly to memory in the <see cref="SequenceReader{Byte}"/>, or to <paramref name="copyDestinationIfRequiredDoNotUse"/> if it has been used for copying the value in to</returns>
|
||||
|
@ -102,7 +102,7 @@ namespace Ryujinx.Common.Extensions
|
|||
/// <summary>
|
||||
/// Reads the desired unmanaged value by copying it to the specified <paramref name="value"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <typeparam name="T">Type to read</typeparam>
|
||||
/// <param name="reader">The <see cref="SequenceReader{Byte}"/> to read from</param>
|
||||
/// <param name="value">The target that will receive the read value</param>
|
||||
/// <exception cref="ArgumentOutOfRangeException">The <see cref="SequenceReader{Byte}"/> does not contain enough data to read a value of type <typeparamref name="T"/></exception>
|
||||
|
@ -130,6 +130,7 @@ namespace Ryujinx.Common.Extensions
|
|||
/// Try to read the given type out of the buffer if possible. Warning: this is dangerous to use with arbitrary
|
||||
/// structs - see remarks for full details.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type to read</typeparam>
|
||||
/// <remarks>
|
||||
/// IMPORTANT: The read is a straight copy of bits. If a struct depends on specific state of it's members to
|
||||
/// behave correctly this can lead to exceptions, etc. If reading endian specific integers, use the explicit
|
||||
|
|
Loading…
Add table
Reference in a new issue