IMacroEE.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Ryujinx.Graphics.Device;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Ryujinx.Graphics.Gpu.Engine.MME
  5. {
  6. /// <summary>
  7. /// FIFO word.
  8. /// </summary>
  9. readonly struct FifoWord
  10. {
  11. /// <summary>
  12. /// GPU virtual address where the word is located in memory.
  13. /// </summary>
  14. public ulong GpuVa { get; }
  15. /// <summary>
  16. /// Word value.
  17. /// </summary>
  18. public int Word { get; }
  19. /// <summary>
  20. /// Creates a new FIFO word.
  21. /// </summary>
  22. /// <param name="gpuVa">GPU virtual address where the word is located in memory</param>
  23. /// <param name="word">Word value</param>
  24. public FifoWord(ulong gpuVa, int word)
  25. {
  26. GpuVa = gpuVa;
  27. Word = word;
  28. }
  29. }
  30. /// <summary>
  31. /// Macro Execution Engine interface.
  32. /// </summary>
  33. interface IMacroEE
  34. {
  35. /// <summary>
  36. /// Arguments FIFO.
  37. /// </summary>
  38. Queue<FifoWord> Fifo { get; }
  39. /// <summary>
  40. /// Should execute the GPU Macro code being passed.
  41. /// </summary>
  42. /// <param name="code">Code to be executed</param>
  43. /// <param name="state">GPU state at the time of the call</param>
  44. /// <param name="arg0">First argument to be passed to the GPU Macro</param>
  45. void Execute(ReadOnlySpan<int> code, IDeviceState state, int arg0);
  46. }
  47. }