Implement Depth Clamping (#1120)

* Implement Depth Clamping and add misc enums

* Fix formatting
This commit is contained in:
mageven 2020-04-17 06:46:49 +05:30 committed by GitHub
parent 0a7c6caedf
commit 4960ab85f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 3 deletions

View file

@ -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();