aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.OpenGL')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs
index aef3383b..e32b5b85 100644
--- a/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -546,6 +546,21 @@ namespace Ryujinx.Graphics.OpenGL
// GL.PolygonOffsetClamp(factor, units, clamp);
}
+ public void SetDepthClamp(bool clampNear, bool clampFar)
+ {
+ // TODO: Use GL_AMD_depth_clamp_separate or similar if available?
+ // Currently enables clamping if either is set.
+ bool clamp = clampNear || clampFar;
+
+ if (!clamp)
+ {
+ GL.Disable(EnableCap.DepthClamp);
+ return;
+ }
+
+ GL.Enable(EnableCap.DepthClamp);
+ }
+
public void SetDepthMode(DepthMode mode)
{
ClipDepthMode depthMode = mode.Convert();