aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/DrawIndexedCommand.cs
blob: 8d43d4564a9a611334c5a660e1a68638c711f279 (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 DrawCommand : IGALCommand, IGALCommand<DrawCommand>
    {
        public readonly CommandType CommandType => CommandType.Draw;
        private int _vertexCount;
        private int _instanceCount;
        private int _firstVertex;
        private int _firstInstance;

        public void Set(int vertexCount, int instanceCount, int firstVertex, int firstInstance)
        {
            _vertexCount = vertexCount;
            _instanceCount = instanceCount;
            _firstVertex = firstVertex;
            _firstInstance = firstInstance;
        }

        public static void Run(ref DrawCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            renderer.Pipeline.Draw(command._vertexCount, command._instanceCount, command._firstVertex, command._firstInstance);
        }
    }
}