diff options
author | gdkchan <gab.dark.100@gmail.com> | 2021-10-18 18:38:04 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-18 18:38:04 -0300 |
commit | d512ce122cb1c9a7fe7cb40d3f85d642ee37f897 (patch) | |
tree | bd20273250bf8066fa4df4b67c0de2ab9eac8092 /Ryujinx.Graphics.OpenGL/Pipeline.cs | |
parent | 7603dbe3c8b45c8563f320f17ce784151cb1f0a8 (diff) |
Initial tessellation shader support (#2534)
* Initial tessellation shader support
* Nits
* Re-arrange built-in table
* This is not needed anymore
* PR feedback
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r-- | Ryujinx.Graphics.OpenGL/Pipeline.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index dd07afcf..d0a509b4 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -830,6 +830,21 @@ namespace Ryujinx.Graphics.OpenGL GL.LineWidth(width); } + public unsafe void SetPatchParameters(int vertices, ReadOnlySpan<float> defaultOuterLevel, ReadOnlySpan<float> defaultInnerLevel) + { + GL.PatchParameter(PatchParameterInt.PatchVertices, vertices); + + fixed (float* pOuterLevel = defaultOuterLevel) + { + GL.PatchParameter(PatchParameterFloat.PatchDefaultOuterLevel, pOuterLevel); + } + + fixed (float* pInnerLevel = defaultInnerLevel) + { + GL.PatchParameter(PatchParameterFloat.PatchDefaultInnerLevel, pInnerLevel); + } + } + public void SetPointParameters(float size, bool isProgramPointSize, bool enablePointSprite, Origin origin) { // GL_POINT_SPRITE was deprecated in core profile 3.2+ and causes GL_INVALID_ENUM when set. @@ -861,6 +876,19 @@ namespace Ryujinx.Graphics.OpenGL GL.PointSize(Math.Max(float.Epsilon, size)); } + public void SetPolygonMode(GAL.PolygonMode frontMode, GAL.PolygonMode backMode) + { + if (frontMode == backMode) + { + GL.PolygonMode(MaterialFace.FrontAndBack, frontMode.Convert()); + } + else + { + GL.PolygonMode(MaterialFace.Front, frontMode.Convert()); + GL.PolygonMode(MaterialFace.Back, backMode.Convert()); + } + } + public void SetPrimitiveRestart(bool enable, int index) { if (!enable) |