aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-04-14 01:31:27 -0300
committergdkchan <gab.dark.100@gmail.com>2018-04-14 01:31:27 -0300
commit494e6dfa1ef0a46263d9ea8bb3c9e5bd3b23f43c (patch)
treeaf9f0e29eaf2a2930293a874b5cc7a3b398809bf /Ryujinx.Graphics/Gal/OpenGL
parent7dd14a4f3ac7f733e203737f25239d095ee11b31 (diff)
[GPU] Set frame buffer texture size to window size
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs
index affd479b..05a7288a 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs
@@ -55,6 +55,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
private ShaderProgram Shader;
private Rect Viewport;
+ private Rect Window;
private bool IsInitialized;
@@ -77,6 +78,11 @@ namespace Ryujinx.Graphics.Gal.OpenGL
public void Create(long Tag, int Width, int Height)
{
+ //TODO: We should either use the original frame buffer size,
+ //or just remove the Width/Height arguments.
+ Width = Window.Width;
+ Height = Window.Height;
+
if (Fbs.TryGetValue(Tag, out FrameBuffer Fb))
{
if (Fb.Width != Width ||
@@ -119,6 +125,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
GL.DrawBuffer(DrawBufferMode.ColorAttachment0);
+ GL.Viewport(0, 0, Width, Height);
+
Fbs.Add(Tag, Fb);
}
@@ -207,6 +215,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
GL.Uniform2(WindowSizeUniformLocation, new Vector2(Width, Height));
GL.UseProgram(CurrentProgram);
+
+ Window = new Rect(0, 0, Width, Height);
}
public void SetViewport(int X, int Y, int Width, int Height)
@@ -234,7 +244,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
- GL.Viewport(0, 0, 1280, 720);
+ SetViewport(Window);
GL.Clear(
ClearBufferMask.ColorBufferBit |
@@ -255,10 +265,12 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
GL.Enable(EnableCap.Blend);
}
+
+ //GL.Viewport(0, 0, 1280, 720);
}
}
- private void SetViewport()
+ private void SetViewport(Rect Viewport)
{
GL.Viewport(
Viewport.X,