aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Multithreading/Commands/SetSamplerCommand.cs
blob: f3be24dbfef5d80223d31fa31c99413e30e0c0c1 (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 Ryujinx.Graphics.GAL.Multithreading.Resources;

namespace Ryujinx.Graphics.GAL.Multithreading.Commands
{
    struct SetSamplerCommand : IGALCommand
    {
        public CommandType CommandType => CommandType.SetSampler;
        private int _index;
        private TableRef<ISampler> _sampler;

        public void Set(int index, TableRef<ISampler> sampler)
        {
            _index = index;
            _sampler = sampler;
        }

        public static void Run(ref SetSamplerCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            renderer.Pipeline.SetSampler(command._index, command._sampler.GetAs<ThreadedSampler>(threaded)?.Base);
        }
    }
}