TextureCreateViewCommand.cs 1.2 KB

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