diff options
Diffstat (limited to 'Ryujinx.Graphics.GAL/Multithreading/Commands')
6 files changed, 52 insertions, 78 deletions
diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetSamplerCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetSamplerCommand.cs deleted file mode 100644 index f3be24db..00000000 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetSamplerCommand.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Ryujinx.Graphics.GAL.Multithreading.Model; -using Ryujinx.Graphics.GAL.Multithreading.Resources; - -namespace Ryujinx.Graphics.GAL.Multithreading.Commands -{ - struct SetSamplerCommand : IGALCommand - { - public CommandType CommandType => CommandType.SetSampler; - private int _index; - private TableRef<ISampler> _sampler; - - public void Set(int index, TableRef<ISampler> sampler) - { - _index = index; - _sampler = sampler; - } - - public static void Run(ref SetSamplerCommand command, ThreadedRenderer threaded, IRenderer renderer) - { - renderer.Pipeline.SetSampler(command._index, command._sampler.GetAs<ThreadedSampler>(threaded)?.Base); - } - } -} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetScissorCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetScissorCommand.cs deleted file mode 100644 index 6c95d096..00000000 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetScissorCommand.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace Ryujinx.Graphics.GAL.Multithreading.Commands -{ - struct SetScissorCommand : IGALCommand - { - public CommandType CommandType => CommandType.SetScissor; - private int _index; - private bool _enable; - private int _x; - private int _y; - private int _width; - private int _height; - - public void Set(int index, bool enable, int x, int y, int width, int height) - { - _index = index; - _enable = enable; - _x = x; - _y = y; - _width = width; - _height = height; - } - - public static void Run(ref SetScissorCommand command, ThreadedRenderer threaded, IRenderer renderer) - { - renderer.Pipeline.SetScissor(command._index, command._enable, command._x, command._y, command._width, command._height); - } - } -} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetScissorsCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetScissorsCommand.cs new file mode 100644 index 00000000..6966df6d --- /dev/null +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetScissorsCommand.cs @@ -0,0 +1,22 @@ +using Ryujinx.Graphics.GAL.Multithreading.Model; + +namespace Ryujinx.Graphics.GAL.Multithreading.Commands +{ + struct SetScissorsCommand : IGALCommand + { + public CommandType CommandType => CommandType.SetScissor; + private SpanRef<Rectangle<int>> _scissors; + + public void Set(SpanRef<Rectangle<int>> scissors) + { + _scissors = scissors; + } + + public static void Run(ref SetScissorsCommand command, ThreadedRenderer threaded, IRenderer renderer) + { + renderer.Pipeline.SetScissors(command._scissors.Get(threaded)); + + command._scissors.Dispose(threaded); + } + } +} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureAndSamplerCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureAndSamplerCommand.cs new file mode 100644 index 00000000..7ef58c3d --- /dev/null +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureAndSamplerCommand.cs @@ -0,0 +1,28 @@ +using Ryujinx.Graphics.GAL.Multithreading.Model; +using Ryujinx.Graphics.GAL.Multithreading.Resources; +using Ryujinx.Graphics.Shader; + +namespace Ryujinx.Graphics.GAL.Multithreading.Commands +{ + struct SetTextureAndSamplerCommand : IGALCommand + { + public CommandType CommandType => CommandType.SetTextureAndSampler; + private ShaderStage _stage; + private int _binding; + private TableRef<ITexture> _texture; + private TableRef<ISampler> _sampler; + + public void Set(ShaderStage stage, int binding, TableRef<ITexture> texture, TableRef<ISampler> sampler) + { + _stage = stage; + _binding = binding; + _texture = texture; + _sampler = sampler; + } + + public static void Run(ref SetTextureAndSamplerCommand command, ThreadedRenderer threaded, IRenderer renderer) + { + renderer.Pipeline.SetTextureAndSampler(command._stage, command._binding, command._texture.GetAs<ThreadedTexture>(threaded)?.Base, command._sampler.GetAs<ThreadedSampler>(threaded)?.Base); + } + } +} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs deleted file mode 100644 index e86f512b..00000000 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetTextureCommand.cs +++ /dev/null @@ -1,23 +0,0 @@ -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); - } - } -} diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs index b208d9fe..61861f4d 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs @@ -7,13 +7,11 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Commands struct SetViewportsCommand : IGALCommand { public CommandType CommandType => CommandType.SetViewports; - private int _first; private SpanRef<Viewport> _viewports; private bool _disableTransform; - public void Set(int first, SpanRef<Viewport> viewports, bool disableTransform) + public void Set(SpanRef<Viewport> viewports, bool disableTransform) { - _first = first; _viewports = viewports; _disableTransform = disableTransform; } @@ -21,7 +19,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Commands public static void Run(ref SetViewportsCommand command, ThreadedRenderer threaded, IRenderer renderer) { ReadOnlySpan<Viewport> viewports = command._viewports.Get(threaded); - renderer.Pipeline.SetViewports(command._first, viewports, command._disableTransform); + renderer.Pipeline.SetViewports(viewports, command._disableTransform); command._viewports.Dispose(threaded); } } |