This commit is contained in:
Kenny van Vulpen 2018-10-23 23:08:02 +02:00
commit 4802c66fad
No known key found for this signature in database
GPG key ID: BBD011B8B9C45F87
4 changed files with 14 additions and 1 deletions

View file

@ -41,6 +41,8 @@
public bool DepthTestEnabled;
public bool DepthWriteEnabled;
public GalComparisonOp DepthFunc;
public float DepthRangeNear;
public float DepthRangeFar;
public bool StencilTestEnabled;
public bool StencilTwoSideEnabled;

View file

@ -195,7 +195,13 @@ namespace Ryujinx.Graphics.Gal.OpenGL
}
}
if (New.StencilTestEnabled != _old.StencilTestEnabled)
if (New.DepthRangeNear != _old.DepthRangeNear ||
New.DepthRangeFar != _old.DepthRangeFar)
{
GL.DepthRange(New.DepthRangeNear, New.DepthRangeFar);
}
if (New.StencilTestEnabled != _old.StencilTestEnabled)
{
Enable(EnableCap.StencilTest, New.StencilTestEnabled);
}

View file

@ -371,6 +371,9 @@ namespace Ryujinx.Graphics
{
state.DepthFunc = (GalComparisonOp)ReadRegister(NvGpuEngine3DReg.DepthTestFunction);
}
state.DepthRangeNear = ReadRegisterFloat(NvGpuEngine3DReg.DepthRangeNNear);
state.DepthRangeFar = ReadRegisterFloat(NvGpuEngine3DReg.DepthRangeNFar);
}
private void SetStencil(GalPipelineState state)

View file

@ -15,6 +15,8 @@ namespace Ryujinx.Graphics
ViewportNTranslateZ = 0x285,
ViewportNHoriz = 0x300,
ViewportNVert = 0x301,
DepthRangeNNear = 0x302,
DepthRangeNFar = 0x303,
VertexArrayFirst = 0x35d,
VertexArrayCount = 0x35e,
ClearNColor = 0x360,