aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateBufferAccessCommand.cs
blob: 3dbc0b066eb39a4f408e6d3980252286bebb79fc (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));
        }
    }
}