aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Multithreading/Commands/ClearBufferCommand.cs
blob: 2b194b46a7f6742b395238c040ffc2350a817824 (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
namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
    struct ClearBufferCommand : IGALCommand
    {
        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);
        }
    }
}