aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
index c64c760a..2f5d4fc5 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
@@ -166,7 +166,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
nameof(ThreedClassState.BlendEnable),
nameof(ThreedClassState.BlendState)),
- new StateUpdateCallbackEntry(UpdateLogicOpState, nameof(ThreedClassState.LogicOpState))
+ new StateUpdateCallbackEntry(UpdateLogicOpState, nameof(ThreedClassState.LogicOpState)),
+
+ new StateUpdateCallbackEntry(UpdateMultisampleState,
+ nameof(ThreedClassState.AlphaToCoverageDitherEnable),
+ nameof(ThreedClassState.MultisampleControl))
});
}
@@ -1093,6 +1097,20 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
}
/// <summary>
+ /// Updates multisample state, based on guest state.
+ /// </summary>
+ private void UpdateMultisampleState()
+ {
+ bool alphaToCoverageEnable = (_state.State.MultisampleControl & 1) != 0;
+ bool alphaToOneEnable = (_state.State.MultisampleControl & 0x10) != 0;
+
+ _context.Renderer.Pipeline.SetMultisampleState(new MultisampleDescriptor(
+ alphaToCoverageEnable,
+ _state.State.AlphaToCoverageDitherEnable,
+ alphaToOneEnable));
+ }
+
+ /// <summary>
/// Updates host shaders based on the guest GPU state.
/// </summary>
private void UpdateShaderState()
@@ -1231,7 +1249,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
_state.State.EarlyZForce,
_drawState.Topology,
_state.State.TessMode,
- _state.State.ViewportTransformEnable == 0);
+ _state.State.ViewportTransformEnable == 0,
+ (_state.State.MultisampleControl & 1) != 0,
+ _state.State.AlphaToCoverageDitherEnable);
}
/// <summary>