/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Texture / TextureSetDataSliceCommand.cs
TextureSetDataSliceCommand.cs
 1  using Ryujinx.Common.Memory;
 2  using Ryujinx.Graphics.GAL.Multithreading.Model;
 3  using Ryujinx.Graphics.GAL.Multithreading.Resources;
 4  
 5  namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
 6  {
 7      struct TextureSetDataSliceCommand : IGALCommand, IGALCommand<TextureSetDataSliceCommand>
 8      {
 9          public readonly CommandType CommandType => CommandType.TextureSetDataSlice;
10          private TableRef<ThreadedTexture> _texture;
11          private TableRef<MemoryOwner<byte>> _data;
12          private int _layer;
13          private int _level;
14  
15          public void Set(TableRef<ThreadedTexture> texture, TableRef<MemoryOwner<byte>> data, int layer, int level)
16          {
17              _texture = texture;
18              _data = data;
19              _layer = layer;
20              _level = level;
21          }
22  
23          public static void Run(ref TextureSetDataSliceCommand command, ThreadedRenderer threaded, IRenderer renderer)
24          {
25              ThreadedTexture texture = command._texture.Get(threaded);
26              texture.Base.SetData(command._data.Get(threaded), command._layer, command._level);
27          }
28      }
29  }