Ryujinx-git/Ryujinx.Graphics.GAL/Multithreading/Commands/SetRenderTargetColorMasksCommand.cs
gdkchan 7fea26e97e
Remove use of reflection on GAL multithreading (#4287)
* Introduce new IGALCommand<T> interface and use it

* Remove use of reflection on GAL multithreading

* Unmanaged constraint
2023-01-22 01:07:43 +01:00

23 lines
844 B
C#

using Ryujinx.Graphics.GAL.Multithreading.Model;
using System;
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
struct SetRenderTargetColorMasksCommand : IGALCommand, IGALCommand<SetRenderTargetColorMasksCommand>
{
public CommandType CommandType => CommandType.SetRenderTargetColorMasks;
private SpanRef<uint> _componentMask;
public void Set(SpanRef<uint> componentMask)
{
_componentMask = componentMask;
}
public static void Run(ref SetRenderTargetColorMasksCommand command, ThreadedRenderer threaded, IRenderer renderer)
{
ReadOnlySpan<uint> componentMask = command._componentMask.Get(threaded);
renderer.Pipeline.SetRenderTargetColorMasks(componentMask);
command._componentMask.Dispose(threaded);
}
}
}