diff options
Diffstat (limited to 'Ryujinx.Graphics.GAL/Multithreading/Commands/SetStorageBuffersCommand.cs')
-rw-r--r-- | Ryujinx.Graphics.GAL/Multithreading/Commands/SetStorageBuffersCommand.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetStorageBuffersCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetStorageBuffersCommand.cs new file mode 100644 index 00000000..c2963373 --- /dev/null +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetStorageBuffersCommand.cs @@ -0,0 +1,25 @@ +using Ryujinx.Graphics.GAL.Multithreading.Model; +using System; + +namespace Ryujinx.Graphics.GAL.Multithreading.Commands +{ + struct SetStorageBuffersCommand : IGALCommand + { + public CommandType CommandType => CommandType.SetStorageBuffers; + private int _first; + private SpanRef<BufferRange> _buffers; + + public void Set(int first, SpanRef<BufferRange> buffers) + { + _first = first; + _buffers = buffers; + } + + public static void Run(ref SetStorageBuffersCommand command, ThreadedRenderer threaded, IRenderer renderer) + { + Span<BufferRange> buffers = command._buffers.Get(threaded); + renderer.Pipeline.SetStorageBuffers(command._first, threaded.Buffers.MapBufferRanges(buffers)); + command._buffers.Dispose(threaded); + } + } +} |