From d512ce122cb1c9a7fe7cb40d3f85d642ee37f897 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
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
---
 .../Commands/SetPatchParametersCommand.cs          | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs

(limited to 'Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs')

diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs
new file mode 100644
index 00000000..7847e8d0
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs
@@ -0,0 +1,25 @@
+using Ryujinx.Common.Memory;
+using System;
+
+namespace Ryujinx.Graphics.GAL.Multithreading.Commands
+{
+    struct SetPatchParametersCommand : IGALCommand
+    {
+        public CommandType CommandType => CommandType.SetPatchParameters;
+        private int _vertices;
+        private Array4<float> _defaultOuterLevel;
+        private Array2<float> _defaultInnerLevel;
+
+        public void Set(int vertices, ReadOnlySpan<float> defaultOuterLevel, ReadOnlySpan<float> defaultInnerLevel)
+        {
+            _vertices = vertices;
+            defaultOuterLevel.CopyTo(_defaultOuterLevel.ToSpan());
+            defaultInnerLevel.CopyTo(_defaultInnerLevel.ToSpan());
+        }
+
+        public static void Run(ref SetPatchParametersCommand command, ThreadedRenderer threaded, IRenderer renderer)
+        {
+            renderer.Pipeline.SetPatchParameters(command._vertices, command._defaultOuterLevel.ToSpan(), command._defaultInnerLevel.ToSpan());
+        }
+    }
+}
-- 
cgit v1.2.3-70-g09d2