aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-06-28 00:11:49 -0300
committergdkchan <gab.dark.100@gmail.com>2018-06-28 00:11:49 -0300
commit22f138628bd05419791d3b569ec558bbf322398d (patch)
tree1bfbafc07dd3269158279523a8a6bb9cfb76e1fa /Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
parente6eeb6f09ff592f5b27e115d1817654de7568757 (diff)
Somewhat better ClearBuffers implementation
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs19
1 files changed, 9 insertions, 10 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
index 05250696..ebd1e8d1 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
@@ -70,18 +70,15 @@ namespace Ryujinx.Graphics.Gal.OpenGL
IndexBuffer = new IbInfo();
}
- public void ClearBuffers(int RtIndex, GalClearBufferFlags Flags)
+ public void ClearBuffers(GalClearBufferFlags Flags)
{
- ClearBufferMask Mask = 0;
+ ClearBufferMask Mask = ClearBufferMask.ColorBufferBit;
- //TODO: Use glColorMask to clear just the specified channels.
- if (Flags.HasFlag(GalClearBufferFlags.ColorRed) &&
- Flags.HasFlag(GalClearBufferFlags.ColorGreen) &&
- Flags.HasFlag(GalClearBufferFlags.ColorBlue) &&
- Flags.HasFlag(GalClearBufferFlags.ColorAlpha))
- {
- Mask = ClearBufferMask.ColorBufferBit;
- }
+ GL.ColorMask(
+ Flags.HasFlag(GalClearBufferFlags.ColorRed),
+ Flags.HasFlag(GalClearBufferFlags.ColorGreen),
+ Flags.HasFlag(GalClearBufferFlags.ColorBlue),
+ Flags.HasFlag(GalClearBufferFlags.ColorAlpha));
if (Flags.HasFlag(GalClearBufferFlags.Depth))
{
@@ -94,6 +91,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
}
GL.Clear(Mask);
+
+ GL.ColorMask(true, true, true, true);
}
public bool IsVboCached(long Key, long DataSize)