aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs')
-rw-r--r--Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs
new file mode 100644
index 00000000..e86f512b
--- /dev/null
+++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs
@@ -0,0 +1,23 @@
+using Ryujinx.Graphics.GAL.Multithreading.Model;
+using Ryujinx.Graphics.GAL.Multithreading.Resources;
+
+namespace Ryujinx.Graphics.GAL.Multithreading.Commands
+{
+ struct SetTextureCommand : IGALCommand
+ {
+ public CommandType CommandType => CommandType.SetTexture;
+ private int _binding;
+ private TableRef<ITexture> _texture;
+
+ public void Set(int binding, TableRef<ITexture> texture)
+ {
+ _binding = binding;
+ _texture = texture;
+ }
+
+ public static void Run(ref SetTextureCommand command, ThreadedRenderer threaded, IRenderer renderer)
+ {
+ renderer.Pipeline.SetTexture(command._binding, command._texture.GetAs<ThreadedTexture>(threaded)?.Base);
+ }
+ }
+}