Ryujinx/Ryujinx.Graphics/Gal/OpenGL/OGLRenderer.cs
gdkchan 59964f667c
Add support for bigger UBOs, fix sRGB regression, small improvement t… (#503)
* Add support for bigger UBOs, fix sRGB regression, small improvement to the 2D copy engine

* Break into multiple lines

* Read fractions for source/step values on the 2d copy engine aswell

* Use fixed point math for more speed

* Fix reinterpret when texture sizes are different
2018-11-28 21:09:44 -02:00

58 lines
No EOL
1.5 KiB
C#

using System;
using System.Collections.Concurrent;
namespace Ryujinx.Graphics.Gal.OpenGL
{
public class OGLRenderer : IGalRenderer
{
public IGalConstBuffer Buffer { get; private set; }
public IGalRenderTarget RenderTarget { 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();
Texture = new OGLTexture();
RenderTarget = new OGLRenderTarget(Texture as OGLTexture);
Rasterizer = new OGLRasterizer();
Shader = new OGLShader(Buffer as OGLConstBuffer);
Pipeline = new OGLPipeline(
Buffer as OGLConstBuffer,
RenderTarget as OGLRenderTarget,
Rasterizer as OGLRasterizer,
Shader as OGLShader);
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();
}
}
}
}