aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Pipeline.cs
diff options
context:
space:
mode:
authormageven <62494521+mageven@users.noreply.github.com>2020-04-17 06:46:49 +0530
committerGitHub <noreply@github.com>2020-04-17 11:16:49 +1000
commit4960ab85f81f48553b7217261f4181e31d812a10 (patch)
tree765970f8b028fa965abef43bda308964deaff32d /Ryujinx.Graphics.OpenGL/Pipeline.cs
parent0a7c6caedffd59011077b49cd6493c7a841a66f5 (diff)
Implement Depth Clamping (#1120)
* Implement Depth Clamping and add misc enums * Fix formatting
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-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();