SetTextureCommand.cs 758 B

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