aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-10-18 18:38:04 -0300
committerGitHub <noreply@github.com>2021-10-18 18:38:04 -0300
commitd512ce122cb1c9a7fe7cb40d3f85d642ee37f897 (patch)
treebd20273250bf8066fa4df4b67c0de2ab9eac8092 /Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs
parent7603dbe3c8b45c8563f320f17ce784151cb1f0a8 (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.GAL/Multithreading/Commands/SetPatchParametersCommand.cs')
-rw-r--r--Ryujinx.Graphics.GAL/Multithreading/Commands/SetPatchParametersCommand.cs25
1 files changed, 25 insertions, 0 deletions
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());
+ }
+ }
+}