aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs
blob: e86f512be4000e5c8c7fed14850cf00d7451baee (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 SetTextureCommand : IGALCommand
    {
        public CommandType CommandType => CommandType.SetTexture;
        private int _binding;
        private TableRef<ITexture> _texture;

        public void Set(int binding, TableRef<ITexture> texture)
        {
            _binding = binding;
            _texture = texture;
        }

        public static void Run(ref SetTextureCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            renderer.Pipeline.SetTexture(command._binding, command._texture.GetAs<ThreadedTexture>(threaded)?.Base);
        }
    }
}