aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu')
-rw-r--r--Ryujinx.Graphics.Gpu/Engine/Methods.cs16
-rw-r--r--Ryujinx.Graphics.Gpu/State/LogicalOpState.cs12
-rw-r--r--Ryujinx.Graphics.Gpu/State/MethodOffset.cs1
3 files changed, 29 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
index 5677c8a0..06298cdf 100644
--- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs
+++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs
@@ -252,6 +252,11 @@ namespace Ryujinx.Graphics.Gpu.Engine
UpdateBlendState(state);
}
+ if (state.QueryModified(MethodOffset.LogicOpState))
+ {
+ UpdateLogicOpState(state);
+ }
+
CommitBindings();
}
@@ -876,6 +881,17 @@ namespace Ryujinx.Graphics.Gpu.Engine
}
/// <summary>
+ /// Updates host logical operation state, based on guest state.
+ /// </summary>
+ /// <param name="state">Current GPU state</param>
+ public void UpdateLogicOpState(GpuState state)
+ {
+ LogicalOpState logicOpState = state.Get<LogicalOpState>(MethodOffset.LogicOpState);
+
+ _context.Renderer.Pipeline.SetLogicOpState(logicOpState.Enable, logicOpState.LogicalOp);
+ }
+
+ /// <summary>
/// Storage buffer address and size information.
/// </summary>
private struct SbDescriptor
diff --git a/Ryujinx.Graphics.Gpu/State/LogicalOpState.cs b/Ryujinx.Graphics.Gpu/State/LogicalOpState.cs
new file mode 100644
index 00000000..d052a45c
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/State/LogicalOpState.cs
@@ -0,0 +1,12 @@
+using Ryujinx.Graphics.GAL;
+
+namespace Ryujinx.Graphics.Gpu.State
+{
+ struct LogicalOpState
+ {
+#pragma warning disable CS0649
+ public Boolean32 Enable;
+ public LogicalOp LogicalOp;
+#pragma warning restore CS0649
+ }
+}
diff --git a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
index 2e0a197e..d7d5d903 100644
--- a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
+++ b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
@@ -92,6 +92,7 @@ namespace Ryujinx.Graphics.Gpu.State
FaceState = 0x646,
ViewportTransformEnable = 0x64b,
ViewVolumeClipControl = 0x64f,
+ LogicOpState = 0x671,
Clear = 0x674,
RtColorMask = 0x680,
ReportState = 0x6c0,