aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-05 17:34:47 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commite25b7c9848b6ec486eb513297b5c536857665c7f (patch)
treec1ccb6c58bed0f7ece835359516330104feb8f4d /Ryujinx.Graphics.Gpu/State
parent6a98c643cabeea25dc42e19fe475a687a034a532 (diff)
Initial support for the guest OpenGL driver (NVIDIA and Nouveau)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/State')
-rw-r--r--Ryujinx.Graphics.Gpu/State/BlendStateCommon.cs16
-rw-r--r--Ryujinx.Graphics.Gpu/State/GpuState.cs22
-rw-r--r--Ryujinx.Graphics.Gpu/State/MethodOffset.cs5
-rw-r--r--Ryujinx.Graphics.Gpu/State/SamplerIndex.cs8
4 files changed, 51 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/State/BlendStateCommon.cs b/Ryujinx.Graphics.Gpu/State/BlendStateCommon.cs
new file mode 100644
index 00000000..96465a25
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/State/BlendStateCommon.cs
@@ -0,0 +1,16 @@
+using Ryujinx.Graphics.GAL.Blend;
+
+namespace Ryujinx.Graphics.Gpu.State
+{
+ struct BlendStateCommon
+ {
+ public Boolean32 SeparateAlpha;
+ public BlendOp ColorOp;
+ public BlendFactor ColorSrcFactor;
+ public BlendFactor ColorDstFactor;
+ public BlendOp AlphaOp;
+ public BlendFactor AlphaSrcFactor;
+ public uint Unknown0x1354;
+ public BlendFactor AlphaDstFactor;
+ }
+}
diff --git a/Ryujinx.Graphics.Gpu/State/GpuState.cs b/Ryujinx.Graphics.Gpu/State/GpuState.cs
index bf7734dd..13f777c9 100644
--- a/Ryujinx.Graphics.Gpu/State/GpuState.cs
+++ b/Ryujinx.Graphics.Gpu/State/GpuState.cs
@@ -162,6 +162,28 @@ namespace Ryujinx.Graphics.Gpu.State
return modified;
}
+ public bool QueryModified(
+ MethodOffset m1,
+ MethodOffset m2,
+ MethodOffset m3,
+ MethodOffset m4,
+ MethodOffset m5)
+ {
+ bool modified = _registers[(int)m1].Modified ||
+ _registers[(int)m2].Modified ||
+ _registers[(int)m3].Modified ||
+ _registers[(int)m4].Modified ||
+ _registers[(int)m5].Modified;
+
+ _registers[(int)m1].Modified = false;
+ _registers[(int)m2].Modified = false;
+ _registers[(int)m3].Modified = false;
+ _registers[(int)m4].Modified = false;
+ _registers[(int)m5].Modified = false;
+
+ return modified;
+ }
+
public T Get<T>(MethodOffset offset, int index) where T : struct
{
Register register = _registers[(int)offset];
diff --git a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
index 4c5e0beb..a560c257 100644
--- a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
+++ b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs
@@ -32,11 +32,16 @@ namespace Ryujinx.Graphics.Gpu.State
RtDepthStencilState = 0x3f8,
VertexAttribState = 0x458,
RtDepthStencilSize = 0x48a,
+ SamplerIndex = 0x48d,
DepthTestEnable = 0x4b3,
+ BlendIndependent = 0x4b9,
DepthWriteEnable = 0x4ba,
DepthTestFunc = 0x4c3,
+ BlendStateCommon = 0x4cf,
+ BlendEnableCommon = 0x4d7,
BlendEnable = 0x4d8,
StencilTestState = 0x4e0,
+ YControl = 0x4eb,
FirstVertex = 0x50d,
FirstInstance = 0x50e,
ResetCounter = 0x54c,
diff --git a/Ryujinx.Graphics.Gpu/State/SamplerIndex.cs b/Ryujinx.Graphics.Gpu/State/SamplerIndex.cs
new file mode 100644
index 00000000..651983f1
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/State/SamplerIndex.cs
@@ -0,0 +1,8 @@
+namespace Ryujinx.Graphics.Gpu.State
+{
+ enum SamplerIndex
+ {
+ Independently = 0,
+ ViaHeaderIndex = 1
+ }
+} \ No newline at end of file