diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-04-14 01:14:42 -0300 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-04-14 01:14:42 -0300 |
| commit | 7dd14a4f3ac7f733e203737f25239d095ee11b31 (patch) | |
| tree | f01191ad0e262951c5c5c5edacfd9ccc70433323 | |
| parent | 42ebfdff7f2889be38a3415bf33aeb41df90bd98 (diff) | |
[GPU] Send correct window size to the vertex shader
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs | 13 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OpenGLRenderer.cs | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs index e0da9179..affd479b 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 5e066e3f..cf2da91c 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) |
