aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateBufferAccessCommand.cs
blob: 5efa0a7afd05cf01bfea3a51f9629056c57988e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
    struct CreateBufferAccessCommand : IGALCommand, IGALCommand<CreateBufferAccessCommand>
    {
        public readonly CommandType CommandType => CommandType.CreateBufferAccess;
        private BufferHandle _threadedHandle;
        private int _size;
        private BufferAccess _access;

        public void Set(BufferHandle threadedHandle, int size, BufferAccess access)
        {
            _threadedHandle = threadedHandle;
            _size = size;
            _access = access;
        }

        public static void Run(ref CreateBufferAccessCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            threaded.Buffers.AssignBuffer(command._threadedHandle, renderer.CreateBuffer(command._size, command._access));
        }
    }
}