ReportCounterCommand.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. using Ryujinx.Graphics.GAL.Multithreading.Model;
  2. using Ryujinx.Graphics.GAL.Multithreading.Resources;
  3. using System;
  4. namespace Ryujinx.Graphics.GAL.Multithreading.Commands.Renderer
  5. {
  6. struct ReportCounterCommand : IGALCommand
  7. {
  8. public CommandType CommandType => CommandType.ReportCounter;
  9. private TableRef<ThreadedCounterEvent> _event;
  10. private CounterType _type;
  11. private TableRef<EventHandler<ulong>> _resultHandler;
  12. private bool _hostReserved;
  13. public void Set(TableRef<ThreadedCounterEvent> evt, CounterType type, TableRef<EventHandler<ulong>> resultHandler, bool hostReserved)
  14. {
  15. _event = evt;
  16. _type = type;
  17. _resultHandler = resultHandler;
  18. _hostReserved = hostReserved;
  19. }
  20. public static void Run(ref ReportCounterCommand command, ThreadedRenderer threaded, IRenderer renderer)
  21. {
  22. ThreadedCounterEvent evt = command._event.Get(threaded);
  23. evt.Create(renderer, command._type, command._resultHandler.Get(threaded), command._hostReserved);
  24. }
  25. }
  26. }