SetProgramCommand.cs
1 using Ryujinx.Graphics.GAL.Multithreading.Model; 2 using Ryujinx.Graphics.GAL.Multithreading.Resources; 3 4 namespace Ryujinx.Graphics.GAL.Multithreading.Commands 5 { 6 struct SetProgramCommand : IGALCommand, IGALCommand<SetProgramCommand> 7 { 8 public readonly CommandType CommandType => CommandType.SetProgram; 9 private TableRef<IProgram> _program; 10 11 public void Set(TableRef<IProgram> program) 12 { 13 _program = program; 14 } 15 16 public static void Run(ref SetProgramCommand command, ThreadedRenderer threaded, IRenderer renderer) 17 { 18 ThreadedProgram program = command._program.GetAs<ThreadedProgram>(threaded); 19 20 threaded.Programs.WaitForProgram(program); 21 22 renderer.Pipeline.SetProgram(program.Base); 23 } 24 } 25 }