SetVertexAttribsCommand.cs 815 B

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