diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-03-29 00:02:58 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-29 14:02:58 +1100 |
commit | ab4867505ec0d3f5a9ec4f042ccd6f7890e3632e (patch) | |
tree | b3956fc821e0dcb8c8c3edc9dcae5eadf83ce29d /Ryujinx.Graphics.OpenGL/Window.cs | |
parent | 06bf25521ff3ab2ad82eb49cde2bb6f90324caa2 (diff) |
Implement GPU scissors (#1058)
* Implement GPU scissors
* Remove unused using
* Add missing changes for Clear
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Window.cs')
-rw-r--r-- | Ryujinx.Graphics.OpenGL/Window.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Window.cs b/Ryujinx.Graphics.OpenGL/Window.cs index 2689a7c4..c9b7daeb 100644 --- a/Ryujinx.Graphics.OpenGL/Window.cs +++ b/Ryujinx.Graphics.OpenGL/Window.cs @@ -9,13 +9,17 @@ namespace Ryujinx.Graphics.OpenGL private const int NativeWidth = 1280; private const int NativeHeight = 720; + private readonly Renderer _renderer; + private int _width; private int _height; private int _copyFramebufferHandle; - public Window() + public Window(Renderer renderer) { + _renderer = renderer; + _width = NativeWidth; _height = NativeHeight; } @@ -35,13 +39,13 @@ namespace Ryujinx.Graphics.OpenGL _height = height; } - private void CopyTextureToFrameBufferRGB(int drawFramebuffer, int readFramebuffer, TextureView view, ImageCrop crop) { bool[] oldFramebufferColorWritemask = new bool[4]; int oldReadFramebufferHandle = GL.GetInteger(GetPName.ReadFramebufferBinding); int oldDrawFramebufferHandle = GL.GetInteger(GetPName.DrawFramebufferBinding); + GL.GetBoolean(GetIndexedPName.ColorWritemask, drawFramebuffer, oldFramebufferColorWritemask); GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, drawFramebuffer); @@ -55,6 +59,8 @@ namespace Ryujinx.Graphics.OpenGL GL.ReadBuffer(ReadBufferMode.ColorAttachment0); + GL.Disable(EnableCap.ScissorTest); + GL.Clear(ClearBufferMask.ColorBufferBit); int srcX0, srcX1, srcY0, srcY1; @@ -119,6 +125,8 @@ namespace Ryujinx.Graphics.OpenGL GL.BindFramebuffer(FramebufferTarget.ReadFramebuffer, oldReadFramebufferHandle); GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, oldDrawFramebufferHandle); + + ((Pipeline)_renderer.Pipeline).RestoreScissorEnable(); } private int GetCopyFramebufferHandleLazy() |