aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
diff options
context:
space:
mode:
authorgdk <gab.dark.100@gmail.com>2019-10-26 14:50:52 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit8cba252b238ee6cf6599ad2fc57793e6f76c5e2e (patch)
tree5ee98eb374a46e210d4a960f5e1d58b42b3f27eb /Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
parent1b7d95519569639135a68e7ebda5148f3263217c (diff)
Add per-source type memory change tracking, simplified state change tracking, other fixes
Diffstat (limited to 'Ryujinx.Graphics.Gpu/State/GpuStateTable.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/State/GpuStateTable.cs56
1 files changed, 56 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs b/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
new file mode 100644
index 00000000..268b1fdc
--- /dev/null
+++ b/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace Ryujinx.Graphics.Gpu.State
+{
+ static class GpuStateTable
+ {
+ public struct TableItem
+ {
+ public MethodOffset Offset { get; }
+
+ public int Size { get; }
+ public int Count { get; }
+
+ public TableItem(MethodOffset offset, Type type, int count)
+ {
+ int sizeInBytes = Marshal.SizeOf(type);
+
+ Debug.Assert((sizeInBytes & 3) == 0);
+
+ Offset = offset;
+ Size = sizeInBytes / 4;
+ Count = count;
+ }
+ }
+
+ public static TableItem[] Table = new TableItem[]
+ {
+ new TableItem(MethodOffset.RtColorState, typeof(RtColorState), 8),
+ new TableItem(MethodOffset.ViewportTransform, typeof(ViewportTransform), 8),
+ new TableItem(MethodOffset.ViewportExtents, typeof(ViewportExtents), 8),
+ new TableItem(MethodOffset.VertexBufferDrawState, typeof(VertexBufferDrawState), 1),
+ new TableItem(MethodOffset.DepthBiasState, typeof(DepthBiasState), 1),
+ new TableItem(MethodOffset.StencilBackMasks, typeof(StencilBackMasks), 1),
+ new TableItem(MethodOffset.RtDepthStencilState, typeof(RtDepthStencilState), 1),
+ new TableItem(MethodOffset.VertexAttribState, typeof(VertexAttribState), 16),
+ new TableItem(MethodOffset.RtDepthStencilSize, typeof(Size3D), 1),
+ new TableItem(MethodOffset.BlendEnable, typeof(Boolean32), 8),
+ new TableItem(MethodOffset.StencilTestState, typeof(StencilTestState), 1),
+ new TableItem(MethodOffset.SamplerPoolState, typeof(PoolState), 1),
+ new TableItem(MethodOffset.TexturePoolState, typeof(PoolState), 1),
+ new TableItem(MethodOffset.StencilBackTestState, typeof(StencilBackTestState), 1),
+ new TableItem(MethodOffset.ShaderBaseAddress, typeof(GpuVa), 1),
+ new TableItem(MethodOffset.PrimitiveRestartState, typeof(PrimitiveRestartState), 1),
+ new TableItem(MethodOffset.IndexBufferState, typeof(IndexBufferState), 1),
+ new TableItem(MethodOffset.VertexBufferInstanced, typeof(Boolean32), 16),
+ new TableItem(MethodOffset.FaceState, typeof(FaceState), 1),
+ new TableItem(MethodOffset.RtColorMask, typeof(RtColorMask), 8),
+ new TableItem(MethodOffset.VertexBufferState, typeof(VertexBufferState), 16),
+ new TableItem(MethodOffset.BlendState, typeof(BlendState), 8),
+ new TableItem(MethodOffset.VertexBufferEndAddress, typeof(GpuVa), 16),
+ new TableItem(MethodOffset.ShaderState, typeof(ShaderState), 6),
+ };
+ }
+} \ No newline at end of file