diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2022-07-05 19:58:36 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-05 19:58:36 -0300 |
| commit | b46b63e06a36845175f68331edb5ddeeb34de27b (patch) | |
| tree | 1ca8adf9541d1f68e420feb853a612413d690725 /Ryujinx.Graphics.GAL/Multithreading | |
| parent | 594246ea4727c9377b1c916934d9b257a1b5d0d0 (diff) | |
Add support for alpha to coverage dithering (#3069)
* Add support for alpha to coverage dithering
* Shader cache version bump
* Fix wrong alpha register
* Ensure support buffer is cleared
* New shader specialization based approach
Diffstat (limited to 'Ryujinx.Graphics.GAL/Multithreading')
4 files changed, 27 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs b/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs index 442a9045..95b33bc6 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/CommandHelper.cs @@ -179,6 +179,8 @@ namespace Ryujinx.Graphics.GAL.Multithreading SetLineParametersCommand.Run(ref GetCommand<SetLineParametersCommand>(memory), threaded, renderer); _lookup[(int)CommandType.SetLogicOpState] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => SetLogicOpStateCommand.Run(ref GetCommand<SetLogicOpStateCommand>(memory), threaded, renderer); + _lookup[(int)CommandType.SetMultisampleState] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => + SetMultisampleStateCommand.Run(ref GetCommand<SetMultisampleStateCommand>(memory), threaded, renderer); _lookup[(int)CommandType.SetPatchParameters] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => SetPatchParametersCommand.Run(ref GetCommand<SetPatchParametersCommand>(memory), threaded, renderer); _lookup[(int)CommandType.SetPointParameters] = (Span<byte> memory, ThreadedRenderer threaded, IRenderer renderer) => diff --git a/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs b/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs index 5c42abd1..8f0a0095 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/CommandType.cs @@ -71,6 +71,7 @@ SetIndexBuffer, SetLineParameters, SetLogicOpState, + SetMultisampleState, SetPatchParameters, SetPointParameters, SetPolygonMode, diff --git a/Ryujinx.Graphics.GAL/Multithreading/Commands/SetMultisampleStateCommand.cs b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetMultisampleStateCommand.cs new file mode 100644 index 00000000..f981c6ce --- /dev/null +++ b/Ryujinx.Graphics.GAL/Multithreading/Commands/SetMultisampleStateCommand.cs @@ -0,0 +1,18 @@ +namespace Ryujinx.Graphics.GAL.Multithreading.Commands +{ + struct SetMultisampleStateCommand : IGALCommand + { + public CommandType CommandType => CommandType.SetMultisampleState; + private MultisampleDescriptor _multisample; + + public void Set(MultisampleDescriptor multisample) + { + _multisample = multisample; + } + + public static void Run(ref SetMultisampleStateCommand command, ThreadedRenderer threaded, IRenderer renderer) + { + renderer.Pipeline.SetMultisampleState(command._multisample); + } + } +} diff --git a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs index 2a1f474a..aebf210d 100644 --- a/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs +++ b/Ryujinx.Graphics.GAL/Multithreading/ThreadedPipeline.cs @@ -184,6 +184,12 @@ namespace Ryujinx.Graphics.GAL.Multithreading _renderer.QueueCommand(); } + public void SetMultisampleState(MultisampleDescriptor multisample) + { + _renderer.New<SetMultisampleStateCommand>().Set(multisample); + _renderer.QueueCommand(); + } + public void SetPatchParameters(int vertices, ReadOnlySpan<float> defaultOuterLevel, ReadOnlySpan<float> defaultInnerLevel) { _renderer.New<SetPatchParametersCommand>().Set(vertices, defaultOuterLevel, defaultInnerLevel); |
