Implement Depth Clamping (#1120)
* Implement Depth Clamping and add misc enums * Fix formatting
This commit is contained in:
parent
0a7c6caedf
commit
4960ab85f8
6 changed files with 60 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue