SetImageCommand.cs 899 B

12345678910111213141516171819202122232425
  1. using Ryujinx.Graphics.GAL.Multithreading.Model;
  2. using Ryujinx.Graphics.GAL.Multithreading.Resources;
  3. namespace Ryujinx.Graphics.GAL.Multithreading.Commands
  4. {
  5. struct SetImageCommand : IGALCommand, IGALCommand<SetImageCommand>
  6. {
  7. public CommandType CommandType => CommandType.SetImage;
  8. private int _binding;
  9. private TableRef<ITexture> _texture;
  10. private Format _imageFormat;
  11. public void Set(int binding, TableRef<ITexture> texture, Format imageFormat)
  12. {
  13. _binding = binding;
  14. _texture = texture;
  15. _imageFormat = imageFormat;
  16. }
  17. public static void Run(ref SetImageCommand command, ThreadedRenderer threaded, IRenderer renderer)
  18. {
  19. renderer.Pipeline.SetImage(command._binding, command._texture.GetAs<ThreadedTexture>(threaded)?.Base, command._imageFormat);
  20. }
  21. }
  22. }