TextureCopyToCommand.cs 1.1 KB

12345678910111213141516171819202122232425262728
  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 TextureCopyToCommand : IGALCommand
  6. {
  7. public CommandType CommandType => CommandType.TextureCopyTo;
  8. private TableRef<ThreadedTexture> _texture;
  9. private TableRef<ThreadedTexture> _destination;
  10. private int _firstLayer;
  11. private int _firstLevel;
  12. public void Set(TableRef<ThreadedTexture> texture, TableRef<ThreadedTexture> destination, int firstLayer, int firstLevel)
  13. {
  14. _texture = texture;
  15. _destination = destination;
  16. _firstLayer = firstLayer;
  17. _firstLevel = firstLevel;
  18. }
  19. public static void Run(ref TextureCopyToCommand command, ThreadedRenderer threaded, IRenderer renderer)
  20. {
  21. ThreadedTexture source = command._texture.Get(threaded);
  22. source.Base.CopyTo(command._destination.Get(threaded).Base, command._firstLayer, command._firstLevel);
  23. }
  24. }
  25. }