aboutsummaryrefslogblamecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/Renderer/CreateHostBufferCommand.cs
blob: e25f84687819b977a9256cbce04257fe3c70d28e (plain) (tree)




















                                                                                                                           
namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
{
    struct CreateHostBufferCommand : IGALCommand, IGALCommand<CreateHostBufferCommand>
    {
        public CommandType CommandType => CommandType.CreateHostBuffer;
        private BufferHandle _threadedHandle;
        private nint _pointer;
        private int _size;

        public void Set(BufferHandle threadedHandle, nint pointer, int size)
        {
            _threadedHandle = threadedHandle;
            _pointer = pointer;
            _size = size;
        }

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