/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / TextureArray / TextureArraySetTexturesCommand.cs
TextureArraySetTexturesCommand.cs
 1  using Ryujinx.Graphics.GAL.Multithreading.Model;
 2  using Ryujinx.Graphics.GAL.Multithreading.Resources;
 3  using System.Linq;
 4  
 5  namespace Ryujinx.Graphics.GAL.Multithreading.Commands.TextureArray
 6  {
 7      struct TextureArraySetTexturesCommand : IGALCommand, IGALCommand<TextureArraySetTexturesCommand>
 8      {
 9          public readonly CommandType CommandType => CommandType.TextureArraySetTextures;
10          private TableRef<ThreadedTextureArray> _textureArray;
11          private int _index;
12          private TableRef<ITexture[]> _textures;
13  
14          public void Set(TableRef<ThreadedTextureArray> textureArray, int index, TableRef<ITexture[]> textures)
15          {
16              _textureArray = textureArray;
17              _index = index;
18              _textures = textures;
19          }
20  
21          public static void Run(ref TextureArraySetTexturesCommand command, ThreadedRenderer threaded, IRenderer renderer)
22          {
23              ThreadedTextureArray textureArray = command._textureArray.Get(threaded);
24              textureArray.Base.SetTextures(command._index, command._textures.Get(threaded).Select(texture => ((ThreadedTexture)texture)?.Base).ToArray());
25          }
26      }
27  }