mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-26 17:26:02 +00:00
25dd5f4238
* Add GalPipelineState and IGalPipeline * Separate UploadVertex call * Add ConstBuffer cache * Move Vertex Assembly into GalPipelineState * Move Uniform binds to GalPipelineState * Move framebuffer flip into a buffer * Rebase * Fix regression * Move clear values from VertexEndGl to ClearBuffers * Rename obscure names O->Old S->New
54 lines
No EOL
1.4 KiB
C#
54 lines
No EOL
1.4 KiB
C#
using System;
|
|
using System.Collections.Concurrent;
|
|
|
|
namespace Ryujinx.Graphics.Gal.OpenGL
|
|
{
|
|
public class OGLRenderer : IGalRenderer
|
|
{
|
|
public IGalConstBuffer Buffer { get; private set; }
|
|
|
|
public IGalFrameBuffer FrameBuffer { get; private set; }
|
|
|
|
public IGalRasterizer Rasterizer { get; private set; }
|
|
|
|
public IGalShader Shader { get; private set; }
|
|
|
|
public IGalPipeline Pipeline { get; private set; }
|
|
|
|
public IGalTexture Texture { get; private set; }
|
|
|
|
private ConcurrentQueue<Action> ActionsQueue;
|
|
|
|
public OGLRenderer()
|
|
{
|
|
Buffer = new OGLConstBuffer();
|
|
|
|
FrameBuffer = new OGLFrameBuffer();
|
|
|
|
Rasterizer = new OGLRasterizer();
|
|
|
|
Shader = new OGLShader(Buffer as OGLConstBuffer);
|
|
|
|
Pipeline = new OGLPipeline(Buffer as OGLConstBuffer, Rasterizer as OGLRasterizer, Shader as 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();
|
|
}
|
|
}
|
|
}
|
|
} |