SetProgramCommand.cs 768 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 SetProgramCommand : IGALCommand
  6. {
  7. public CommandType CommandType => CommandType.SetProgram;
  8. private TableRef<IProgram> _program;
  9. public void Set(TableRef<IProgram> program)
  10. {
  11. _program = program;
  12. }
  13. public static void Run(ref SetProgramCommand command, ThreadedRenderer threaded, IRenderer renderer)
  14. {
  15. ThreadedProgram program = command._program.GetAs<ThreadedProgram>(threaded);
  16. threaded.Programs.WaitForProgram(program);
  17. renderer.Pipeline.SetProgram(program.Base);
  18. }
  19. }
  20. }