0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-24 00:45:46 +00:00
ryujinx-fork/Ryujinx.Graphics.GAL/Multithreading/Commands/ClearBufferCommand.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

24 lines
847 B
C#

namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
struct ClearBufferCommand : IGALCommand, IGALCommand<ClearBufferCommand>
{
public CommandType CommandType => CommandType.ClearBuffer;
private BufferHandle _destination;
private int _offset;
private int _size;
private uint _value;
public void Set(BufferHandle destination, int offset, int size, uint value)
{
_destination = destination;
_offset = offset;
_size = size;
_value = value;
}
public static void Run(ref ClearBufferCommand command, ThreadedRenderer threaded, IRenderer renderer)
{
renderer.Pipeline.ClearBuffer(threaded.Buffers.MapBuffer(command._destination), command._offset, command._size, command._value);
}
}
}