aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Multithreading/Commands/CopyBufferCommand.cs
blob: e8f80d9817fd32460201b9873758a937888197b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
    struct CopyBufferCommand : IGALCommand
    {
        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);
        }
    }
}