TextureSetDataCommand.cs 860 B

12345678910111213141516171819202122232425
  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 TextureSetDataCommand : IGALCommand
  7. {
  8. public CommandType CommandType => CommandType.TextureSetData;
  9. private TableRef<ThreadedTexture> _texture;
  10. private TableRef<byte[]> _data;
  11. public void Set(TableRef<ThreadedTexture> texture, TableRef<byte[]> data)
  12. {
  13. _texture = texture;
  14. _data = data;
  15. }
  16. public static void Run(ref TextureSetDataCommand command, ThreadedRenderer threaded, IRenderer renderer)
  17. {
  18. ThreadedTexture texture = command._texture.Get(threaded);
  19. texture.Base.SetData(new ReadOnlySpan<byte>(command._data.Get(threaded)));
  20. }
  21. }
  22. }