aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs b/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs
index 5ae5e225..bdedfc1a 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs
@@ -1,6 +1,7 @@
using OpenTK;
using OpenTK.Graphics.OpenGL;
using System;
+using System.Collections.Concurrent;
using System.Collections.Generic;
namespace Ryujinx.Graphics.Gal.OpenGL
@@ -24,7 +25,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
private Texture[] Textures;
- private Queue<Action> ActionsQueue;
+ private ConcurrentQueue<Action> ActionsQueue;
private FrameBuffer FbRenderer;
@@ -34,7 +35,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Textures = new Texture[8];
- ActionsQueue = new Queue<Action>();
+ ActionsQueue = new ConcurrentQueue<Action>();
}
public void InitializeFrameBuffer()
@@ -51,9 +52,9 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
int Count = ActionsQueue.Count;
- while (Count-- > 0)
+ while (Count-- > 0 && ActionsQueue.TryDequeue(out Action RenderAction))
{
- ActionsQueue.Dequeue()();
+ RenderAction();
}
}
@@ -86,6 +87,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
int Height,
float ScaleX,
float ScaleY,
+ float OffsX,
+ float OffsY,
float Rotate)
{
Matrix2 Transform;
@@ -93,7 +96,9 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Transform = Matrix2.CreateScale(ScaleX, ScaleY);
Transform *= Matrix2.CreateRotation(Rotate);
- FbRenderer.Set(Fb, Width, Height, Transform);
+ Vector2 Offs = new Vector2(OffsX, OffsY);
+
+ FbRenderer.Set(Fb, Width, Height, Transform, Offs);
}
public void SendVertexBuffer(int Index, byte[] Buffer, int Stride, GalVertexAttrib[] Attribs)