/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Texture / TextureCopyToCommand.cs
TextureCopyToCommand.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 TextureCopyToCommand : IGALCommand, IGALCommand<TextureCopyToCommand>
 7      {
 8          public readonly CommandType CommandType => CommandType.TextureCopyTo;
 9          private TableRef<ThreadedTexture> _texture;
10          private TableRef<ThreadedTexture> _destination;
11          private int _firstLayer;
12          private int _firstLevel;
13  
14          public void Set(TableRef<ThreadedTexture> texture, TableRef<ThreadedTexture> destination, int firstLayer, int firstLevel)
15          {
16              _texture = texture;
17              _destination = destination;
18              _firstLayer = firstLayer;
19              _firstLevel = firstLevel;
20          }
21  
22          public static void Run(ref TextureCopyToCommand command, ThreadedRenderer threaded, IRenderer renderer)
23          {
24              ThreadedTexture source = command._texture.Get(threaded);
25              source.Base.CopyTo(command._destination.Get(threaded).Base, command._firstLayer, command._firstLevel);
26          }
27      }
28  }