IRenderer.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. uint ProgramCount { get; }
  13. void BackgroundContextAction(Action action, bool alwaysBackground = false);
  14. BufferHandle CreateBuffer(int size, BufferAccess access = BufferAccess.Default);
  15. BufferHandle CreateBuffer(nint pointer, int size);
  16. BufferHandle CreateBufferSparse(ReadOnlySpan<BufferRange> storageBuffers);
  17. IImageArray CreateImageArray(int size, bool isBuffer);
  18. IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info);
  19. ISampler CreateSampler(SamplerCreateInfo info);
  20. ITexture CreateTexture(TextureCreateInfo info);
  21. ITextureArray CreateTextureArray(int size, bool isBuffer);
  22. bool PrepareHostMapping(nint address, ulong size);
  23. void CreateSync(ulong id, bool strict);
  24. void DeleteBuffer(BufferHandle buffer);
  25. PinnedSpan<byte> GetBufferData(BufferHandle buffer, int offset, int size);
  26. Capabilities GetCapabilities();
  27. ulong GetCurrentSync();
  28. HardwareInfo GetHardwareInfo();
  29. IProgram LoadProgramBinary(byte[] programBinary, bool hasFragmentShader, ShaderInfo info);
  30. void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data);
  31. void UpdateCounters();
  32. void PreFrame();
  33. ICounterEvent ReportCounter(CounterType type, EventHandler<ulong> resultHandler, float divisor, bool hostReserved);
  34. void ResetCounter(CounterType type);
  35. void RunLoop(ThreadStart gpuLoop)
  36. {
  37. gpuLoop();
  38. }
  39. void WaitSync(ulong id);
  40. void Initialize(GraphicsDebugLevel logLevel);
  41. void SetInterruptAction(Action<Action> interruptAction);
  42. void Screenshot();
  43. }
  44. }