1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-21 16:32:00 +00:00
Ryujinx/Ryujinx.Graphics.GAL/Multithreading/Commands/CopyBufferCommand.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

26 lines
1,009 B
C#

namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
struct CopyBufferCommand : IGALCommand, IGALCommand<CopyBufferCommand>
{
public CommandType CommandType => CommandType.CopyBuffer;
private BufferHandle _source;
private BufferHandle _destination;
private int _srcOffset;
private int _dstOffset;
private int _size;
public void Set(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size)
{
_source = source;
_destination = destination;
_srcOffset = srcOffset;
_dstOffset = dstOffset;
_size = size;
}
public static void Run(ref CopyBufferCommand command, ThreadedRenderer threaded, IRenderer renderer)
{
renderer.Pipeline.CopyBuffer(threaded.Buffers.MapBuffer(command._source), threaded.Buffers.MapBuffer(command._destination), command._srcOffset, command._dstOffset, command._size);
}
}
}