From b46b63e06a36845175f68331edb5ddeeb34de27b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 5 Jul 2022 19:58:36 -0300 Subject: 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 --- Ryujinx.Graphics.OpenGL/Pipeline.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs') diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index 62d4dee9..fde86424 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -918,6 +918,34 @@ namespace Ryujinx.Graphics.OpenGL } } + public void SetMultisampleState(MultisampleDescriptor multisample) + { + if (multisample.AlphaToCoverageEnable) + { + GL.Enable(EnableCap.SampleAlphaToCoverage); + + if (multisample.AlphaToOneEnable) + { + GL.Enable(EnableCap.SampleAlphaToOne); + } + else + { + GL.Disable(EnableCap.SampleAlphaToOne); + } + + if (HwCapabilities.SupportsAlphaToCoverageDitherControl) + { + GL.NV.AlphaToCoverageDitherControl(multisample.AlphaToCoverageDitherEnable + ? NvAlphaToCoverageDitherControl.AlphaToCoverageDitherEnableNv + : NvAlphaToCoverageDitherControl.AlphaToCoverageDitherDisableNv); + } + } + else + { + GL.Disable(EnableCap.SampleAlphaToCoverage); + } + } + public void SetLineParameters(float width, bool smooth) { if (smooth) -- cgit v1.2.3