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