aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-07-11 17:20:40 -0300
committerGitHub <noreply@github.com>2021-07-11 17:20:40 -0300
commit40b21cc3c4d2622bbd4f88d43073341854d9a671 (patch)
tree6e9dc6a42e7c0bae5b03db468481771d5a6937ef /Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
parentb5190f16810eb77388c861d1d1773e19644808db (diff)
Separate GPU engines (part 2/2) (#2440)
* 3D engine now uses DeviceState too, plus new state modification tracking * Remove old methods code * Remove GpuState and friends * Optimize DeviceState, force inline some functions * This change was not supposed to go in * Proper channel initialization * Optimize state read/write methods even more * Fix debug build * Do not dirty state if the write is redundant * The YControl register should dirty either the viewport or front face state too, to update the host origin * Avoid redundant vertex buffer updates * Move state and get rid of the Ryujinx.Graphics.Gpu.State namespace * Comments and nits * Fix rebase * PR feedback * Move changed = false to improve codegen * PR feedback * Carry RyuJIT a bit more
Diffstat (limited to 'Ryujinx.Graphics.Gpu/State/GpuStateTable.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/State/GpuStateTable.cs87
1 files changed, 0 insertions, 87 deletions
diff --git a/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs b/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
deleted file mode 100644
index 899e0a59..00000000
--- a/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs
+++ /dev/null
@@ -1,87 +0,0 @@
-using Ryujinx.Graphics.GAL;
-using System;
-using System.Diagnostics;
-using System.Runtime.InteropServices;
-
-namespace Ryujinx.Graphics.Gpu.State
-{
- /// <summary>
- /// GPU State item sizes table.
- /// </summary>
- static class GpuStateTable
- {
- /// <summary>
- /// GPU state table item, with size for structures, and count for indexed state data.
- /// </summary>
- public struct TableItem
- {
- /// <summary>
- /// Offset of the data.
- /// </summary>
- public MethodOffset Offset { get; }
-
- /// <summary>
- /// Size in words.
- /// </summary>
- public int Size { get; }
-
- /// <summary>
- /// Count for indexed data, or 1 if not indexed.
- /// </summary>
- public int Count { get; }
-
- /// <summary>
- /// Constructs the table item structure.
- /// </summary>
- /// <param name="offset">Data offset</param>
- /// <param name="type">Data type</param>
- /// <param name="count">Data count, for indexed data</param>
- 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;
- }
- }
-
- /// <summary>
- /// Table of GPU state structure sizes and counts.
- /// </summary>
- public static TableItem[] Table = new TableItem[]
- {
- new TableItem(MethodOffset.TfBufferState, typeof(TfBufferState), Constants.TotalTransformFeedbackBuffers),
- new TableItem(MethodOffset.TfState, typeof(TfState), Constants.TotalTransformFeedbackBuffers),
- new TableItem(MethodOffset.RtColorState, typeof(RtColorState), Constants.TotalRenderTargets),
- new TableItem(MethodOffset.ViewportTransform, typeof(ViewportTransform), Constants.TotalViewports),
- new TableItem(MethodOffset.ViewportExtents, typeof(ViewportExtents), Constants.TotalViewports),
- new TableItem(MethodOffset.VertexBufferDrawState, typeof(VertexBufferDrawState), 1),
- new TableItem(MethodOffset.DepthBiasState, typeof(DepthBiasState), 1),
- new TableItem(MethodOffset.ScissorState, typeof(ScissorState), Constants.TotalViewports),
- new TableItem(MethodOffset.StencilBackMasks, typeof(StencilBackMasks), 1),
- new TableItem(MethodOffset.RtDepthStencilState, typeof(RtDepthStencilState), 1),
- new TableItem(MethodOffset.VertexAttribState, typeof(VertexAttribState), Constants.TotalVertexAttribs),
- new TableItem(MethodOffset.RtDepthStencilSize, typeof(Size3D), 1),
- new TableItem(MethodOffset.BlendEnable, typeof(Boolean32), Constants.TotalRenderTargets),
- 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), Constants.TotalVertexBuffers),
- new TableItem(MethodOffset.FaceState, typeof(FaceState), 1),
- new TableItem(MethodOffset.RtColorMask, typeof(RtColorMask), Constants.TotalRenderTargets),
- new TableItem(MethodOffset.VertexBufferState, typeof(VertexBufferState), Constants.TotalVertexBuffers),
- new TableItem(MethodOffset.BlendConstant, typeof(ColorF), 1),
- new TableItem(MethodOffset.BlendStateCommon, typeof(BlendStateCommon), 1),
- new TableItem(MethodOffset.BlendState, typeof(BlendState), Constants.TotalRenderTargets),
- new TableItem(MethodOffset.VertexBufferEndAddress, typeof(GpuVa), Constants.TotalVertexBuffers),
- new TableItem(MethodOffset.ShaderState, typeof(ShaderState), Constants.ShaderStages + 1),
- };
- }
-} \ No newline at end of file