From 0e1e094b7a8f0134831fc4cebdb0841b9c10fe6a Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 17 Oct 2018 18:02:23 -0300 Subject: Improve texture tables (#457) * Improve texture tables * More renaming and other tweaks * Minor tweaks --- Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs') diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs index 7b435c45..cefbb2d2 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs @@ -5,8 +5,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL { class OGLRasterizer : IGalRasterizer { - public bool DepthWriteEnabled { set; private get; } - private int[] VertexBuffers; private OGLCachedResource VboCache; @@ -30,8 +28,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL IboCache = new OGLCachedResource(GL.DeleteBuffer); IndexBuffer = new IbInfo(); - - DepthWriteEnabled = true; } public void LockCaches() @@ -49,17 +45,15 @@ namespace Ryujinx.Graphics.Gal.OpenGL public void ClearBuffers( GalClearBufferFlags Flags, int Attachment, - float Red, float Green, float Blue, float Alpha, + float Red, + float Green, + float Blue, + float Alpha, float Depth, int Stencil) { - //OpenGL needs glDepthMask to be enabled to clear it - if (!DepthWriteEnabled) - { - GL.DepthMask(true); - } - GL.ColorMask( + Attachment, Flags.HasFlag(GalClearBufferFlags.ColorRed), Flags.HasFlag(GalClearBufferFlags.ColorGreen), Flags.HasFlag(GalClearBufferFlags.ColorBlue), @@ -67,6 +61,9 @@ namespace Ryujinx.Graphics.Gal.OpenGL GL.ClearBuffer(ClearBuffer.Color, Attachment, new float[] { Red, Green, Blue, Alpha }); + GL.ColorMask(Attachment, true, true, true, true); + GL.DepthMask(true); + if (Flags.HasFlag(GalClearBufferFlags.Depth)) { GL.ClearBuffer(ClearBuffer.Depth, 0, ref Depth); @@ -76,13 +73,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL { GL.ClearBuffer(ClearBuffer.Stencil, 0, ref Stencil); } - - GL.ColorMask(true, true, true, true); - - if (!DepthWriteEnabled) - { - GL.DepthMask(false); - } } public bool IsVboCached(long Key, long DataSize) -- cgit v1.2.3