IRenderer.cs 1.6 KB

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