TextureCopyToSliceCommand.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 TextureCopyToSliceCommand : IGALCommand, IGALCommand<TextureCopyToSliceCommand> 7 { 8 public readonly CommandType CommandType => CommandType.TextureCopyToSlice; 9 private TableRef<ThreadedTexture> _texture; 10 private TableRef<ThreadedTexture> _destination; 11 private int _srcLayer; 12 private int _dstLayer; 13 private int _srcLevel; 14 private int _dstLevel; 15 16 public void Set(TableRef<ThreadedTexture> texture, TableRef<ThreadedTexture> destination, int srcLayer, int dstLayer, int srcLevel, int dstLevel) 17 { 18 _texture = texture; 19 _destination = destination; 20 _srcLayer = srcLayer; 21 _dstLayer = dstLayer; 22 _srcLevel = srcLevel; 23 _dstLevel = dstLevel; 24 } 25 26 public static void Run(ref TextureCopyToSliceCommand command, ThreadedRenderer threaded, IRenderer renderer) 27 { 28 ThreadedTexture source = command._texture.Get(threaded); 29 source.Base.CopyTo(command._destination.Get(threaded).Base, command._srcLayer, command._dstLayer, command._srcLevel, command._dstLevel); 30 } 31 } 32 }