diff options
Diffstat (limited to 'Ryujinx.Graphics.GAL')
4 files changed, 14 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.GAL/IPipeline.cs b/Ryujinx.Graphics.GAL/IPipeline.cs index 75c3077e..aec096e7 100644 --- a/Ryujinx.Graphics.GAL/IPipeline.cs +++ b/Ryujinx.Graphics.GAL/IPipeline.cs @@ -94,7 +94,7 @@ namespace Ryujinx.Graphics.GAL void SetVertexAttribs(ReadOnlySpan<VertexAttribDescriptor> vertexAttribs); void SetVertexBuffers(ReadOnlySpan<VertexBufferDescriptor> vertexBuffers); - void SetViewports(int first, ReadOnlySpan<Viewport> viewports); + void SetViewports(int first, ReadOnlySpan<Viewport> viewports, bool disableTransform); void TextureBarrier(); void TextureBarrierTiled(); diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs index e11b00e8..b208d9fe 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetViewportsCommand.cs @@ -9,17 +9,19 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Commands public CommandType CommandType => CommandType.SetViewports; private int _first; private SpanRef<Viewport> _viewports; + private bool _disableTransform; - public void Set(int first, SpanRef<Viewport> viewports) + public void Set(int first, SpanRef<Viewport> viewports, bool disableTransform) { _first = first; _viewports = viewports; + _disableTransform = disableTransform; } public static void Run(ref SetViewportsCommand command, ThreadedRenderer threaded, IRenderer renderer) { ReadOnlySpan<Viewport> viewports = command._viewports.Get(threaded); - renderer.Pipeline.SetViewports(command._first, viewports); + renderer.Pipeline.SetViewports(command._first, viewports, command._disableTransform); command._viewports.Dispose(threaded); } } diff --git a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs index b6acfaa8..010ee7e6 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs @@ -304,9 +304,9 @@ namespace Ryujinx.Graphics.GAL.Multithreading _renderer.QueueCommand(); } - public void SetViewports(int first, ReadOnlySpan<Viewport> viewports) + public void SetViewports(int first, ReadOnlySpan<Viewport> viewports, bool disableTransform) { - _renderer.New<SetViewportsCommand>().Set(first, _renderer.CopySpan(viewports)); + _renderer.New<SetViewportsCommand>().Set(first, _renderer.CopySpan(viewports), disableTransform); _renderer.QueueCommand(); } diff --git a/Ryujinx.Graphics.GAL/SupportBufferUpdater.cs b/Ryujinx.Graphics.GAL/SupportBufferUpdater.cs index cb24bdd7..da7a2461 100644 --- a/Ryujinx.Graphics.GAL/SupportBufferUpdater.cs +++ b/Ryujinx.Graphics.GAL/SupportBufferUpdater.cs @@ -72,6 +72,13 @@ namespace Ryujinx.Graphics.GAL UpdateGenericField(SupportBuffer.FragmentIsBgraOffset, data, Data.FragmentIsBgra.ToSpan(), offset, count); } + public void UpdateViewportInverse(Vector4<float> data) + { + Data.ViewportInverse = data; + + MarkDirty(SupportBuffer.ViewportInverseOffset, SupportBuffer.FieldSize); + } + public void Commit() { if (_startOffset != -1) |
