Somewhat better ClearBuffers implementation

This commit is contained in:
gdkchan 2018-06-28 00:11:49 -03:00
parent e6eeb6f09f
commit 22f138628b
3 changed files with 16 additions and 19 deletions

View file

@ -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)