diff --git a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs index e50438a10a..a417f950a5 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs @@ -399,6 +399,13 @@ namespace Ryujinx.Graphics.Metal } } + public readonly void UpdateRasterizerDiscard(bool discard) + { + _currentState.Pipeline.RasterizerDiscardEnable = discard; + + SignalDirty(DirtyFlags.RenderPipeline); + } + public readonly void UpdateRenderTargets(ITexture[] colors, ITexture depthStencil) { _currentState.FramebufferUsingColorWriteMask = false; @@ -656,6 +663,14 @@ namespace Ryujinx.Graphics.Metal SignalDirty(DirtyFlags.DepthBias); } + public readonly void UpdateMultisampleState(MultisampleDescriptor multisample) + { + _currentState.Pipeline.AlphaToCoverageEnable = multisample.AlphaToCoverageEnable; + _currentState.Pipeline.AlphaToOneEnable = multisample.AlphaToOneEnable; + + SignalDirty(DirtyFlags.RenderPipeline); + } + public void UpdateScissors(ReadOnlySpan> regions) { for (int i = 0; i < regions.Length; i++) diff --git a/src/Ryujinx.Graphics.Metal/Pipeline.cs b/src/Ryujinx.Graphics.Metal/Pipeline.cs index 87306abcf3..70a6e7c2d8 100644 --- a/src/Ryujinx.Graphics.Metal/Pipeline.cs +++ b/src/Ryujinx.Graphics.Metal/Pipeline.cs @@ -597,7 +597,7 @@ namespace Ryujinx.Graphics.Metal public void SetMultisampleState(MultisampleDescriptor multisample) { - Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!"); + _encoderStateManager.UpdateMultisampleState(multisample); } public void SetPatchParameters(int vertices, ReadOnlySpan defaultOuterLevel, ReadOnlySpan defaultInnerLevel) @@ -638,7 +638,7 @@ namespace Ryujinx.Graphics.Metal public void SetRasterizerDiscard(bool discard) { - Logger.Warning?.Print(LogClass.Gpu, "Not Implemented!"); + _encoderStateManager.UpdateRasterizerDiscard(discard); } public void SetRenderTargetColorMasks(ReadOnlySpan componentMask) diff --git a/src/Ryujinx.Graphics.Metal/State/PipelineState.cs b/src/Ryujinx.Graphics.Metal/State/PipelineState.cs index fa6d5410be..425b9a9777 100644 --- a/src/Ryujinx.Graphics.Metal/State/PipelineState.cs +++ b/src/Ryujinx.Graphics.Metal/State/PipelineState.cs @@ -208,12 +208,9 @@ namespace Ryujinx.Graphics.Metal } } - /* TODO: enable when sharpmetal fixes the bindings - renderPipelineDescriptor.AlphaToCoverageEnabled = AlphaToCoverageEnable; - renderPipelineDescriptor.AlphaToOneEnabled = AlphaToOneEnable; - renderPipelineDescriptor.RasterizationEnabled = !RasterizerDiscardEnable; - */ - + renderPipelineDescriptor.SetAlphaToCoverageEnabled(AlphaToCoverageEnable); + renderPipelineDescriptor.SetAlphaToOneEnabled(AlphaToOneEnable); + renderPipelineDescriptor.SetRasterizationEnabled(!RasterizerDiscardEnable); renderPipelineDescriptor.SampleCount = Math.Max(1, SamplesCount); var vertexDescriptor = BuildVertexDescriptor();