/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Texture / TextureSetDataSliceRegionCommand.cs
TextureSetDataSliceRegionCommand.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 TextureSetDataSliceRegionCommand : IGALCommand, IGALCommand<TextureSetDataSliceRegionCommand> 8 { 9 public readonly CommandType CommandType => CommandType.TextureSetDataSliceRegion; 10 private TableRef<ThreadedTexture> _texture; 11 private TableRef<MemoryOwner<byte>> _data; 12 private int _layer; 13 private int _level; 14 private Rectangle<int> _region; 15 16 public void Set(TableRef<ThreadedTexture> texture, TableRef<MemoryOwner<byte>> data, int layer, int level, Rectangle<int> region) 17 { 18 _texture = texture; 19 _data = data; 20 _layer = layer; 21 _level = level; 22 _region = region; 23 } 24 25 public static void Run(ref TextureSetDataSliceRegionCommand command, ThreadedRenderer threaded, IRenderer renderer) 26 { 27 ThreadedTexture texture = command._texture.Get(threaded); 28 texture.Base.SetData(command._data.Get(threaded), command._layer, command._level, command._region); 29 } 30 } 31 }