IRenderer.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using Ryujinx.Common.Configuration;
  2. using System;
  3. using System.Threading;
  4. namespace Ryujinx.Graphics.GAL
  5. {
  6. public interface IRenderer : IDisposable
  7. {
  8. event EventHandler<ScreenCaptureImageInfo> ScreenCaptured;
  9. bool PreferThreading { get; }
  10. IPipeline Pipeline { get; }
  11. IWindow Window { get; }
  12. void BackgroundContextAction(Action action, bool alwaysBackground = false);
  13. BufferHandle CreateBuffer(int size, BufferHandle storageHint);
  14. BufferHandle CreateBuffer(int size)
  15. {
  16. return CreateBuffer(size, BufferHandle.Null);
  17. }
  18. BufferHandle CreateBuffer(nint pointer, int size);
  19. BufferHandle CreateBuffer(int size, BufferAccess access);
  20. IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info);
  21. ISampler CreateSampler(SamplerCreateInfo info);
  22. ITexture CreateTexture(TextureCreateInfo info);
  23. bool PrepareHostMapping(nint address, ulong size);
  24. void CreateSync(ulong id, bool strict);
  25. void DeleteBuffer(BufferHandle buffer);
  26. PinnedSpan<byte> GetBufferData(BufferHandle buffer, int offset, int size);
  27. Capabilities GetCapabilities();
  28. ulong GetCurrentSync();
  29. HardwareInfo GetHardwareInfo();
  30. IProgram LoadProgramBinary(byte[] programBinary, bool hasFragmentShader, ShaderInfo info);
  31. void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data);
  32. void UpdateCounters();
  33. void PreFrame();
  34. ICounterEvent ReportCounter(CounterType type, EventHandler<ulong> resultHandler, float divisor, bool hostReserved);
  35. void ResetCounter(CounterType type);
  36. void RunLoop(ThreadStart gpuLoop)
  37. {
  38. gpuLoop();
  39. }
  40. void WaitSync(ulong id);
  41. void Initialize(GraphicsDebugLevel logLevel);
  42. void SetInterruptAction(Action<Action> interruptAction);
  43. void Screenshot();
  44. }
  45. }