TextureGetDataCommand.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 TextureGetDataCommand : IGALCommand, IGALCommand<TextureGetDataCommand> 7 { 8 public readonly CommandType CommandType => CommandType.TextureGetData; 9 private TableRef<ThreadedTexture> _texture; 10 private TableRef<ResultBox<PinnedSpan<byte>>> _result; 11 12 public void Set(TableRef<ThreadedTexture> texture, TableRef<ResultBox<PinnedSpan<byte>>> result) 13 { 14 _texture = texture; 15 _result = result; 16 } 17 18 public static void Run(ref TextureGetDataCommand command, ThreadedRenderer threaded, IRenderer renderer) 19 { 20 PinnedSpan<byte> result = command._texture.Get(threaded).Base.GetData(); 21 22 command._result.Get(threaded).Result = result; 23 } 24 } 25 }