aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Pipeline.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-06-14 13:30:39 -0300
committerGitHub <noreply@github.com>2022-06-14 13:30:39 -0300
commit851f56b08a0c3b420f91143b6c6c007b429174a8 (patch)
treed4f331d1de9f4715a22abdc9b1b90b5ce5a3b4ae /Ryujinx.Graphics.OpenGL/Pipeline.cs
parentb1bd6a50b5341f444ceb31bbb0fb64f685828d75 (diff)
Support Array/3D depth-stencil render target, and single layer clears (#3400)1.1.147
* Support Array/3D depth-stencil render target, and single layer clears * Alignment
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs
index 637e4606..62d4dee9 100644
--- a/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -110,7 +110,7 @@ namespace Ryujinx.Graphics.OpenGL
Buffer.Clear(destination, offset, size, value);
}
- public void ClearRenderTargetColor(int index, uint componentMask, ColorF color)
+ public void ClearRenderTargetColor(int index, int layer, uint componentMask, ColorF color)
{
GL.ColorMask(
index,
@@ -119,14 +119,18 @@ namespace Ryujinx.Graphics.OpenGL
(componentMask & 4) != 0,
(componentMask & 8) != 0);
+ _framebuffer.AttachColorLayerForClear(index, layer);
+
float[] colors = new float[] { color.Red, color.Green, color.Blue, color.Alpha };
GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Color, index, colors);
+ _framebuffer.DetachColorLayerForClear(index);
+
RestoreComponentMask(index);
}
- public void ClearRenderTargetDepthStencil(float depthValue, bool depthMask, int stencilValue, int stencilMask)
+ public void ClearRenderTargetDepthStencil(int layer, float depthValue, bool depthMask, int stencilValue, int stencilMask)
{
bool stencilMaskChanged =
stencilMask != 0 &&
@@ -144,6 +148,8 @@ namespace Ryujinx.Graphics.OpenGL
GL.DepthMask(depthMask);
}
+ _framebuffer.AttachDepthStencilLayerForClear(layer);
+
if (depthMask && stencilMask != 0)
{
GL.ClearBuffer(ClearBufferCombined.DepthStencil, 0, depthValue, stencilValue);
@@ -157,6 +163,8 @@ namespace Ryujinx.Graphics.OpenGL
GL.ClearBuffer(OpenTK.Graphics.OpenGL.ClearBuffer.Stencil, 0, ref stencilValue);
}
+ _framebuffer.DetachDepthStencilLayerForClear();
+
if (stencilMaskChanged)
{
GL.StencilMaskSeparate(StencilFace.Front, _stencilFrontMask);