/ src / Ryujinx.Graphics.GAL / Multithreading / Commands / SetStorageBuffersCommand.cs
SetStorageBuffersCommand.cs
 1  using Ryujinx.Graphics.GAL.Multithreading.Model;
 2  using System;
 3  
 4  namespace Ryujinx.Graphics.GAL.Multithreading.Commands
 5  {
 6      struct SetStorageBuffersCommand : IGALCommand, IGALCommand<SetStorageBuffersCommand>
 7      {
 8          public readonly CommandType CommandType => CommandType.SetStorageBuffers;
 9          private SpanRef<BufferAssignment> _buffers;
10  
11          public void Set(SpanRef<BufferAssignment> buffers)
12          {
13              _buffers = buffers;
14          }
15  
16          public static void Run(ref SetStorageBuffersCommand command, ThreadedRenderer threaded, IRenderer renderer)
17          {
18              Span<BufferAssignment> buffers = command._buffers.Get(threaded);
19              renderer.Pipeline.SetStorageBuffers(threaded.Buffers.MapBufferRanges(buffers));
20              command._buffers.Dispose(threaded);
21          }
22      }
23  }