aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.GAL/Multithreading/Commands/ImageArray/ImageArraySetFormatsCommand.cs
blob: 8e3ba88a887c14f135cf993abf7c22632805afba (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
25
26
using Ryujinx.Graphics.GAL.Multithreading.Model;
using Ryujinx.Graphics.GAL.Multithreading.Resources;

namespace Ryujinx.Graphics.GAL.Multithreading.Commands.ImageArray
{
    struct ImageArraySetFormatsCommand : IGALCommand, IGALCommand<ImageArraySetFormatsCommand>
    {
        public readonly CommandType CommandType => CommandType.ImageArraySetFormats;
        private TableRef<ThreadedImageArray> _imageArray;
        private int _index;
        private TableRef<Format[]> _imageFormats;

        public void Set(TableRef<ThreadedImageArray> imageArray, int index, TableRef<Format[]> imageFormats)
        {
            _imageArray = imageArray;
            _index = index;
            _imageFormats = imageFormats;
        }

        public static void Run(ref ImageArraySetFormatsCommand command, ThreadedRenderer threaded, IRenderer renderer)
        {
            ThreadedImageArray imageArray = command._imageArray.Get(threaded);
            imageArray.Base.SetFormats(command._index, command._imageFormats.Get(threaded));
        }
    }
}