mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 17:45:26 +00:00
4c2ab880ef
* Ryujinx.Audio: Remove BOM from files * misc: Relicense Ryujinx.Audio under the terms of the MIT license With the approvals of all the Ryujinx.Audio contributors, this commit changes Ryujinx.Audio license from LGPLv3 to MIT.
48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using Ryujinx.Audio.Renderer.Server.Performance;
|
|
|
|
namespace Ryujinx.Audio.Renderer.Dsp.Command
|
|
{
|
|
public class PerformanceCommand : ICommand
|
|
{
|
|
public enum Type
|
|
{
|
|
Invalid,
|
|
Start,
|
|
End
|
|
}
|
|
|
|
public bool Enabled { get; set; }
|
|
|
|
public int NodeId { get; }
|
|
|
|
public CommandType CommandType => CommandType.Performance;
|
|
|
|
public ulong EstimatedProcessingTime { get; set; }
|
|
|
|
public PerformanceEntryAddresses PerformanceEntryAddresses { get; }
|
|
|
|
public Type PerformanceType { get; set; }
|
|
|
|
public PerformanceCommand(ref PerformanceEntryAddresses performanceEntryAddresses, Type performanceType, int nodeId)
|
|
{
|
|
Enabled = true;
|
|
PerformanceEntryAddresses = performanceEntryAddresses;
|
|
PerformanceType = performanceType;
|
|
NodeId = nodeId;
|
|
}
|
|
|
|
public void Process(CommandList context)
|
|
{
|
|
if (PerformanceType == Type.Start)
|
|
{
|
|
PerformanceEntryAddresses.SetStartTime(context.GetTimeElapsedSinceDspStartedProcessing());
|
|
}
|
|
else if (PerformanceType == Type.End)
|
|
{
|
|
PerformanceEntryAddresses.SetProcessingTime(context.GetTimeElapsedSinceDspStartedProcessing());
|
|
PerformanceEntryAddresses.IncrementEntryCount();
|
|
}
|
|
}
|
|
}
|
|
}
|