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