Small OpenGL Renderer refactoring (#177)
* Call OpenGL functions directly, remove the pfifo thread, some refactoring * Fix PerformanceStatistics calculating the wrong host fps, remove wait event on PFIFO as this wasn't exactly was causing the freezes (may replace with an exception later) * Organized the Gpu folder a bit more, renamed a few things, address PR feedback * Make PerformanceStatistics thread safe * Remove unused constant * Use unlimited update rate for better pref
This commit is contained in:
parent
69697957e6
commit
e7559f128f
58 changed files with 518 additions and 633 deletions
50
Ryujinx.Graphics/Gal/OpenGL/OGLRenderer.cs
Normal file
50
Ryujinx.Graphics/Gal/OpenGL/OGLRenderer.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace Ryujinx.Graphics.Gal.OpenGL
|
||||
{
|
||||
public class OGLRenderer : IGalRenderer
|
||||
{
|
||||
public IGalBlend Blend { get; private set; }
|
||||
|
||||
public IGalFrameBuffer FrameBuffer { get; private set; }
|
||||
|
||||
public IGalRasterizer Rasterizer { get; private set; }
|
||||
|
||||
public IGalShader Shader { get; private set; }
|
||||
|
||||
public IGalTexture Texture { get; private set; }
|
||||
|
||||
private ConcurrentQueue<Action> ActionsQueue;
|
||||
|
||||
public OGLRenderer()
|
||||
{
|
||||
Blend = new OGLBlend();
|
||||
|
||||
FrameBuffer = new OGLFrameBuffer();
|
||||
|
||||
Rasterizer = new OGLRasterizer();
|
||||
|
||||
Shader = new OGLShader();
|
||||
|
||||
Texture = new OGLTexture();
|
||||
|
||||
ActionsQueue = new ConcurrentQueue<Action>();
|
||||
}
|
||||
|
||||
public void QueueAction(Action ActionMthd)
|
||||
{
|
||||
ActionsQueue.Enqueue(ActionMthd);
|
||||
}
|
||||
|
||||
public void RunActions()
|
||||
{
|
||||
int Count = ActionsQueue.Count;
|
||||
|
||||
while (Count-- > 0 && ActionsQueue.TryDequeue(out Action RenderAction))
|
||||
{
|
||||
RenderAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue