TextureCopyToSliceCommand.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. using Ryujinx.Graphics.GAL.Multithreading.Model;
  2. using Ryujinx.Graphics.GAL.Multithreading.Resources;
  3. namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
  4. {
  5. struct TextureCopyToSliceCommand : IGALCommand
  6. {
  7. public CommandType CommandType => CommandType.TextureCopyToSlice;
  8. private TableRef<ThreadedTexture> _texture;
  9. private TableRef<ThreadedTexture> _destination;
  10. private int _srcLayer;
  11. private int _dstLayer;
  12. private int _srcLevel;
  13. private int _dstLevel;
  14. public void Set(TableRef<ThreadedTexture> texture, TableRef<ThreadedTexture> destination, int srcLayer, int dstLayer, int srcLevel, int dstLevel)
  15. {
  16. _texture = texture;
  17. _destination = destination;
  18. _srcLayer = srcLayer;
  19. _dstLayer = dstLayer;
  20. _srcLevel = srcLevel;
  21. _dstLevel = dstLevel;
  22. }
  23. public static void Run(ref TextureCopyToSliceCommand command, ThreadedRenderer threaded, IRenderer renderer)
  24. {
  25. ThreadedTexture source = command._texture.Get(threaded);
  26. source.Base.CopyTo(command._destination.Get(threaded).Base, command._srcLayer, command._dstLayer, command._srcLevel, command._dstLevel);
  27. }
  28. }
  29. }