aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-08-19 22:25:26 -0300
committergdkchan <gab.dark.100@gmail.com>2018-08-19 22:25:26 -0300
commit726de8c46ab10f1b0684fe14bca1ca96ba6d2832 (patch)
tree5da68699e9062f1c01ef3da9d9eceb75657b2f93 /Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
parent056c2840b1851657c3855fb72776837c89ff59d3 (diff)
Rendertarget attachments, texture and image changes (#358)
* Add multiple color outputs for fragment shaders * Add registers and gal enums * Use textures for framebuffers and split color and zeta framebuffers * Abstract texture and framebuffer targets as an image * Share images between framebuffers and textures * Unstub formats * Add some formats * Disable multiple attachments * Cache framebuffer attachments * Handle format types * Add some rendertarget formats * Code cleanup * Fixup half float types * Address feedback * Disable multiple attachments in shaders * Add A4B4G4R4 image format * Add reversed section for image enums
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs19
1 files changed, 6 insertions, 13 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
index b6e97454..45106692 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs
@@ -3,7 +3,7 @@ using System;
namespace Ryujinx.Graphics.Gal.OpenGL
{
- public class OGLRasterizer : IGalRasterizer
+ class OGLRasterizer : IGalRasterizer
{
private int[] VertexBuffers;
@@ -44,36 +44,29 @@ namespace Ryujinx.Graphics.Gal.OpenGL
public void ClearBuffers(
GalClearBufferFlags Flags,
+ int Attachment,
float Red, float Green, float Blue, float Alpha,
float Depth,
int Stencil)
{
- ClearBufferMask Mask = ClearBufferMask.ColorBufferBit;
-
GL.ColorMask(
Flags.HasFlag(GalClearBufferFlags.ColorRed),
Flags.HasFlag(GalClearBufferFlags.ColorGreen),
Flags.HasFlag(GalClearBufferFlags.ColorBlue),
Flags.HasFlag(GalClearBufferFlags.ColorAlpha));
+ GL.ClearBuffer(ClearBuffer.Color, Attachment, new float[] { Red, Green, Blue, Alpha });
+
if (Flags.HasFlag(GalClearBufferFlags.Depth))
{
- Mask |= ClearBufferMask.DepthBufferBit;
+ GL.ClearBuffer(ClearBuffer.Depth, 0, ref Depth);
}
if (Flags.HasFlag(GalClearBufferFlags.Stencil))
{
- Mask |= ClearBufferMask.StencilBufferBit;
+ GL.ClearBuffer(ClearBuffer.Stencil, 0, ref Stencil);
}
- GL.ClearColor(Red, Green, Blue, Alpha);
-
- GL.ClearDepth(Depth);
-
- GL.ClearStencil(Stencil);
-
- GL.Clear(Mask);
-
GL.ColorMask(true, true, true, true);
}