From 7dd14a4f3ac7f733e203737f25239d095ee11b31 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 14 Apr 2018 01:14:42 -0300 Subject: [PATCH] [GPU] Send correct window size to the vertex shader --- Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs | 13 +++++++++++++ Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs index e0da9179a..affd479b7 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs @@ -196,6 +196,19 @@ namespace Ryujinx.Graphics.Gal.OpenGL GL.UseProgram(CurrentProgram); } + public void SetWindowSize(int Width, int Height) + { + int CurrentProgram = GL.GetInteger(GetPName.CurrentProgram); + + GL.UseProgram(Shader.Handle); + + int WindowSizeUniformLocation = GL.GetUniformLocation(Shader.Handle, "window_size"); + + GL.Uniform2(WindowSizeUniformLocation, new Vector2(Width, Height)); + + GL.UseProgram(CurrentProgram); + } + public void SetViewport(int X, int Y, int Width, int Height) { Viewport = new Rect(X, Y, Width, Height); diff --git a/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs b/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs index 5e066e3f1..cf2da91c5 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs @@ -56,7 +56,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL public void SetWindowSize(int Width, int Height) { - //TODO + FrameBuffer.SetWindowSize(Width, Height); } public void SetBlendEnable(bool Enable)