SetStorageBuffersCommand.cs 818 B

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