aboutsummaryrefslogblamecommitdiff
path: root/Ryujinx.Graphics.GAL/IRenderer.cs
blob: cf67f648b78e7677da0d322aa3e5ef5c4f4c91d5 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                   
             

                              
                                            
     
                                                                  
                                     
                                   

                               
                                                                                   
 
                                            
 
                                                                        
                                                       
                                                                    
 
                                  
                                               
                                                                                    
 
                                       
                                       
 
                                                                                                  
 
                                                                                     
                              
 
                        
                                                                                                            
                                            
 



                                    
                                
                                                     
                          
     
using Ryujinx.Common.Configuration;
using System;

namespace Ryujinx.Graphics.GAL
{
    public interface IRenderer : IDisposable
    {
        event EventHandler<ScreenCaptureImageInfo> ScreenCaptured;

        bool PreferThreading { get; }

        IPipeline Pipeline { get; }

        IWindow Window { get; }

        void BackgroundContextAction(Action action, bool alwaysBackground = false);

        BufferHandle CreateBuffer(int size);

        IProgram CreateProgram(ShaderSource[] shaders, ShaderInfo info);

        ISampler CreateSampler(SamplerCreateInfo info);
        ITexture CreateTexture(TextureCreateInfo info, float scale);

        void CreateSync(ulong id);

        void DeleteBuffer(BufferHandle buffer);

        ReadOnlySpan<byte> GetBufferData(BufferHandle buffer, int offset, int size);

        Capabilities GetCapabilities();
        HardwareInfo GetHardwareInfo();

        IProgram LoadProgramBinary(byte[] programBinary, bool hasFragmentShader, ShaderInfo info);

        void SetBufferData(BufferHandle buffer, int offset, ReadOnlySpan<byte> data);

        void UpdateCounters();

        void PreFrame();

        ICounterEvent ReportCounter(CounterType type, EventHandler<ulong> resultHandler, bool hostReserved);

        void ResetCounter(CounterType type);

        void RunLoop(Action gpuLoop)
        {
            gpuLoop();
        }

        void WaitSync(ulong id);

        void Initialize(GraphicsDebugLevel logLevel);

        void Screenshot();
    }
}