aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-08-23 02:07:23 -0300
committergdkchan <gab.dark.100@gmail.com>2018-08-23 02:07:23 -0300
commit624e813cd3e5d782847c577c2da0cfb8a121fd18 (patch)
treefa12638a42a406f1736662f1a2fdee1d9f9bd014 /Ryujinx.Graphics/Gal/OpenGL
parent9977acad0fe08ee98a8174ce1c5609be22ba67ee (diff)
Implement multiple rendertarget attachments and depth writting (#375)
* Add depth writting * Implement multiple attachments * Address feedback
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs33
1 files changed, 19 insertions, 14 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs
index e0f12e4e..12239c4f 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLFrameBuffer.cs
@@ -21,18 +21,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
}
}
- private static readonly DrawBuffersEnum[] DrawBuffers = new DrawBuffersEnum[]
- {
- DrawBuffersEnum.ColorAttachment0,
- DrawBuffersEnum.ColorAttachment1,
- DrawBuffersEnum.ColorAttachment2,
- DrawBuffersEnum.ColorAttachment3,
- DrawBuffersEnum.ColorAttachment4,
- DrawBuffersEnum.ColorAttachment5,
- DrawBuffersEnum.ColorAttachment6,
- DrawBuffersEnum.ColorAttachment7,
- };
-
private const int NativeWidth = 1280;
private const int NativeHeight = 720;
@@ -194,6 +182,25 @@ namespace Ryujinx.Graphics.Gal.OpenGL
ReadTex = RawTex;
}
+ public void SetMap(int[] Map)
+ {
+ if (Map != null && Map.Length > 0)
+ {
+ DrawBuffersEnum[] Mode = new DrawBuffersEnum[Map.Length];
+
+ for (int i = 0; i < Map.Length; i++)
+ {
+ Mode[i] = DrawBuffersEnum.ColorAttachment0 + Map[i];
+ }
+
+ GL.DrawBuffers(Mode.Length, Mode);
+ }
+ else
+ {
+ GL.DrawBuffer(DrawBufferMode.ColorAttachment0);
+ }
+ }
+
public void SetTransform(bool FlipX, bool FlipY, int Top, int Left, int Right, int Bottom)
{
this.FlipX = FlipX;
@@ -421,8 +428,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
}
GL.BindFramebuffer(FramebufferTarget.DrawFramebuffer, DummyFrameBuffer);
-
- GL.DrawBuffers(8, DrawBuffers);
}
private void Attach(ref int OldHandle, int NewHandle, FramebufferAttachment FbAttachment)