aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/SetVertexAttribsCommand.cs
blob: a8a182047900343a2bcd56e7809e4b3a5a5399f3 (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
using Ryujinx.Graphics.GAL.Multithreading.Model;
using System;

namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
    struct SetVertexAttribsCommand : IGALCommand, IGALCommand<SetVertexAttribsCommand>
    {
        public readonly CommandType CommandType => CommandType.SetVertexAttribs;
        private SpanRef<VertexAttribDescriptor> _vertexAttribs;

        public void Set(SpanRef<VertexAttribDescriptor> vertexAttribs)
        {
            _vertexAttribs = vertexAttribs;
        }

        public static void Run(ref SetVertexAttribsCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            ReadOnlySpan<VertexAttribDescriptor> vertexAttribs = command._vertexAttribs.Get(threaded);
            renderer.Pipeline.SetVertexAttribs(vertexAttribs);
            command._vertexAttribs.Dispose(threaded);
        }
    }
}