/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Texture / TextureCopyToBufferCommand.cs
TextureCopyToBufferCommand.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 TextureCopyToBufferCommand : IGALCommand, IGALCommand<TextureCopyToBufferCommand>
 7      {
 8          public readonly CommandType CommandType => CommandType.TextureCopyToBuffer;
 9          private TableRef<ThreadedTexture> _texture;
10          private BufferRange _range;
11          private int _layer;
12          private int _level;
13          private int _stride;
14  
15          public void Set(TableRef<ThreadedTexture> texture, BufferRange range, int layer, int level, int stride)
16          {
17              _texture = texture;
18              _range = range;
19              _layer = layer;
20              _level = level;
21              _stride = stride;
22          }
23  
24          public static void Run(ref TextureCopyToBufferCommand command, ThreadedRenderer threaded, IRenderer renderer)
25          {
26              command._texture.Get(threaded).Base.CopyTo(threaded.Buffers.MapBufferRange(command._range), command._layer, command._level, command._stride);
27          }
28      }
29  }