/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Texture / TextureSetDataCommand.cs
TextureSetDataCommand.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 TextureSetDataCommand : IGALCommand, IGALCommand<TextureSetDataCommand>
 8      {
 9          public readonly CommandType CommandType => CommandType.TextureSetData;
10          private TableRef<ThreadedTexture> _texture;
11          private TableRef<MemoryOwner<byte>> _data;
12  
13          public void Set(TableRef<ThreadedTexture> texture, TableRef<MemoryOwner<byte>> data)
14          {
15              _texture = texture;
16              _data = data;
17          }
18  
19          public static void Run(ref TextureSetDataCommand command, ThreadedRenderer threaded, IRenderer renderer)
20          {
21              ThreadedTexture texture = command._texture.Get(threaded);
22              texture.Base.SetData(command._data.Get(threaded));
23          }
24      }
25  }