TextureSetDataSliceCommand.cs 1.0 KB

1234567891011121314151617181920212223242526272829
  1. using Ryujinx.Graphics.GAL.Multithreading.Model;
  2. using Ryujinx.Graphics.GAL.Multithreading.Resources;
  3. using System;
  4. namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Texture
  5. {
  6. struct TextureSetDataSliceCommand : IGALCommand
  7. {
  8. public CommandType CommandType => CommandType.TextureSetDataSlice;
  9. private TableRef<ThreadedTexture> _texture;
  10. private TableRef<byte[]> _data;
  11. private int _layer;
  12. private int _level;
  13. public void Set(TableRef<ThreadedTexture> texture, TableRef<byte[]> data, int layer, int level)
  14. {
  15. _texture = texture;
  16. _data = data;
  17. _layer = layer;
  18. _level = level;
  19. }
  20. public static void Run(ref TextureSetDataSliceCommand command, ThreadedRenderer threaded, IRenderer renderer)
  21. {
  22. ThreadedTexture texture = command._texture.Get(threaded);
  23. texture.Base.SetData(new ReadOnlySpan<byte>(command._data.Get(threaded)), command._layer, command._level);
  24. }
  25. }
  26. }