/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / Renderer / CreateProgramCommand.cs
CreateProgramCommand.cs
 1  using Ryujinx.Graphics.GAL.Multithreading.Model;
 2  using Ryujinx.Graphics.GAL.Multithreading.Resources.Programs;
 3  
 4  namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
 5  {
 6      struct CreateProgramCommand : IGALCommand, IGALCommand<CreateProgramCommand>
 7      {
 8          public readonly CommandType CommandType => CommandType.CreateProgram;
 9          private TableRef<IProgramRequest> _request;
10  
11          public void Set(TableRef<IProgramRequest> request)
12          {
13              _request = request;
14          }
15  
16          public static void Run(ref CreateProgramCommand command, ThreadedRenderer threaded, IRenderer renderer)
17          {
18              IProgramRequest request = command._request.Get(threaded);
19  
20              if (request.Threaded.Base == null)
21              {
22                  request.Threaded.Base = request.Create(renderer);
23              }
24  
25              threaded.Programs.ProcessQueue();
26          }
27      }
28  }