IRenderer.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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, BufferHandle storageHint);
  13. BufferHandle CreateBuffer(int size)
  14. {
  15. return CreateBuffer(size, BufferHandle.Null);
  16. }
  17. IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info);
  18. ISampler CreateSampler(SamplerCreateInfo info);
  19. ITexture CreateTexture(TextureCreateInfo info, float scale);
  20. void CreateSync(ulong id, bool strict);
  21. void DeleteBuffer(BufferHandle buffer);
  22. PinnedSpan<byte> GetBufferData(BufferHandle buffer, int offset, int size);
  23. Capabilities GetCapabilities();
  24. ulong GetCurrentSync();
  25. HardwareInfo GetHardwareInfo();
  26. IProgram LoadProgramBinary(byte[] programBinary, bool hasFragmentShader, ShaderInfo info);
  27. void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data);
  28. void UpdateCounters();
  29. void PreFrame();
  30. ICounterEvent ReportCounter(CounterType type, EventHandler<ulong> resultHandler, bool hostReserved);
  31. void ResetCounter(CounterType type);
  32. void RunLoop(Action gpuLoop)
  33. {
  34. gpuLoop();
  35. }
  36. void WaitSync(ulong id);
  37. void Initialize(GraphicsDebugLevel logLevel);
  38. void SetInterruptAction(Action<Action> interruptAction);
  39. void Screenshot();
  40. }
  41. }