aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/SetRenderTargetColorMasksCommand.cs
blob: 785c3215fb393cf1a9446d4d90378b21057fc1fd (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 SetRenderTargetColorMasksCommand : IGALCommand, IGALCommand<SetRenderTargetColorMasksCommand>
    {
        public readonly CommandType CommandType => CommandType.SetRenderTargetColorMasks;
        private SpanRef<uint> _componentMask;

        public void Set(SpanRef<uint> componentMask)
        {
            _componentMask = componentMask;
        }

        public static void Run(ref SetRenderTargetColorMasksCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            ReadOnlySpan<uint> componentMask = command._componentMask.Get(threaded);
            renderer.Pipeline.SetRenderTargetColorMasks(componentMask);
            command._componentMask.Dispose(threaded);
        }
    }
}