From d512ce122cb1c9a7fe7cb40d3f85d642ee37f897 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 18 Oct 2021 18:38:04 -0300 Subject: Initial tessellation shader support (#2534) * Initial tessellation shader support * Nits * Re-arrange built-in table * This is not needed anymore * PR feedback --- Ryujinx.Graphics.OpenGL/Pipeline.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs') 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 defaultOuterLevel, ReadOnlySpan 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) -- cgit v1.2.3-70-g09d2