diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-10-23 16:04:08 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-23 16:04:08 -0300 |
| commit | 044b84b078c910c9c1d16c5351cd037716db70e3 (patch) | |
| tree | 3cc3ba67b348025aa5bdafb4780f98816809d6f2 /Ryujinx.Graphics/Gal/OpenGL | |
| parent | e674b377104858d5068231dbe395e1038ba5d71d (diff) | |
Add depth range support on the GPU (#472)
* Add depth range support on the GPU
* Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs index 00699641..656d8e8e 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLPipeline.cs @@ -95,44 +95,46 @@ namespace Ryujinx.Graphics.Gal.OpenGL FrontFace = GalFrontFace.CCW, CullFaceEnabled = false, - CullFace = GalCullFace.Back, + CullFace = GalCullFace.Back, - DepthTestEnabled = false, + DepthTestEnabled = false, DepthWriteEnabled = true, - DepthFunc = GalComparisonOp.Less, + DepthFunc = GalComparisonOp.Less, + DepthRangeNear = 0, + DepthRangeFar = 1, StencilTestEnabled = false, StencilBackFuncFunc = GalComparisonOp.Always, - StencilBackFuncRef = 0, + StencilBackFuncRef = 0, StencilBackFuncMask = UInt32.MaxValue, - StencilBackOpFail = GalStencilOp.Keep, - StencilBackOpZFail = GalStencilOp.Keep, - StencilBackOpZPass = GalStencilOp.Keep, - StencilBackMask = UInt32.MaxValue, + StencilBackOpFail = GalStencilOp.Keep, + StencilBackOpZFail = GalStencilOp.Keep, + StencilBackOpZPass = GalStencilOp.Keep, + StencilBackMask = UInt32.MaxValue, StencilFrontFuncFunc = GalComparisonOp.Always, - StencilFrontFuncRef = 0, + StencilFrontFuncRef = 0, StencilFrontFuncMask = UInt32.MaxValue, - StencilFrontOpFail = GalStencilOp.Keep, - StencilFrontOpZFail = GalStencilOp.Keep, - StencilFrontOpZPass = GalStencilOp.Keep, - StencilFrontMask = UInt32.MaxValue, + StencilFrontOpFail = GalStencilOp.Keep, + StencilFrontOpZFail = GalStencilOp.Keep, + StencilFrontOpZPass = GalStencilOp.Keep, + StencilFrontMask = UInt32.MaxValue, - BlendEnabled = false, + BlendEnabled = false, BlendSeparateAlpha = false, - BlendEquationRgb = 0, - BlendFuncSrcRgb = GalBlendFactor.One, - BlendFuncDstRgb = GalBlendFactor.Zero, + BlendEquationRgb = 0, + BlendFuncSrcRgb = GalBlendFactor.One, + BlendFuncDstRgb = GalBlendFactor.Zero, BlendEquationAlpha = 0, - BlendFuncSrcAlpha = GalBlendFactor.One, - BlendFuncDstAlpha = GalBlendFactor.Zero, + BlendFuncSrcAlpha = GalBlendFactor.One, + BlendFuncDstAlpha = GalBlendFactor.Zero, ColorMask = ColorMaskRgba.Default, PrimitiveRestartEnabled = false, - PrimitiveRestartIndex = 0 + PrimitiveRestartIndex = 0 }; for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++) @@ -195,6 +197,12 @@ namespace Ryujinx.Graphics.Gal.OpenGL } } + 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); |
