mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-29 03:27:11 +02:00
Revert "Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)"
This reverts merge request !47
This commit is contained in:
parent
faf9e3cdd7
commit
77a797f154
307 changed files with 1245 additions and 1016 deletions
|
@ -26,8 +26,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct TessMode
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint Packed;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Unpacks the tessellation abstract patch type.
|
||||
|
@ -62,7 +63,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct TfBufferState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 Enable;
|
||||
public GpuVa Address;
|
||||
public int Size;
|
||||
|
@ -70,7 +71,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public uint Padding0;
|
||||
public uint Padding1;
|
||||
public uint Padding2;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -78,12 +79,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct TfState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public int BufferIndex;
|
||||
public int VaryingsCount;
|
||||
public int Stride;
|
||||
public uint Padding;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -91,7 +92,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct RtColorState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public GpuVa Address;
|
||||
public int WidthOrStride;
|
||||
public int Height;
|
||||
|
@ -107,7 +108,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public int Padding3;
|
||||
public int Padding4;
|
||||
public int Padding5;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -115,7 +116,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct ViewportTransform
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public float ScaleX;
|
||||
public float ScaleY;
|
||||
public float ScaleZ;
|
||||
|
@ -124,6 +125,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public float TranslateZ;
|
||||
public uint Swizzle;
|
||||
public uint SubpixelPrecisionBias;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Unpacks viewport swizzle of the position X component.
|
||||
|
@ -167,14 +169,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct ViewportExtents
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public ushort X;
|
||||
public ushort Width;
|
||||
public ushort Y;
|
||||
public ushort Height;
|
||||
public float DepthNear;
|
||||
public float DepthFar;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -182,10 +184,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct VertexBufferDrawState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public int First;
|
||||
public int Count;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -193,12 +195,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct ClearColors
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public float Red;
|
||||
public float Green;
|
||||
public float Blue;
|
||||
public float Alpha;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -206,11 +208,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct DepthBiasState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 PointEnable;
|
||||
public Boolean32 LineEnable;
|
||||
public Boolean32 FillEnable;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -229,14 +231,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct ScissorState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 Enable;
|
||||
public ushort X1;
|
||||
public ushort X2;
|
||||
public ushort Y1;
|
||||
public ushort Y2;
|
||||
public uint Padding;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -244,11 +246,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct StencilBackMasks
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public int FuncRef;
|
||||
public int Mask;
|
||||
public int FuncMask;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -256,12 +258,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct RtDepthStencilState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public GpuVa Address;
|
||||
public ZetaFormat Format;
|
||||
public MemoryLayout MemoryLayout;
|
||||
public int LayerSize;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -269,12 +271,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct ScreenScissorState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public ushort X;
|
||||
public ushort Width;
|
||||
public ushort Y;
|
||||
public ushort Height;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -317,8 +319,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct VertexAttribState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint Attribute;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Unpacks the index of the vertex buffer this attribute belongs to.
|
||||
|
@ -380,8 +383,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct RtControl
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint Packed;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Unpacks the number of active draw buffers.
|
||||
|
@ -408,7 +412,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct Size3D
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public int Width;
|
||||
public int Height;
|
||||
public ushort Depth;
|
||||
|
@ -418,6 +422,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
{
|
||||
return (Flags & 1) == 0;
|
||||
}
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -425,7 +430,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct StencilTestState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 Enable;
|
||||
public StencilOp FrontSFail;
|
||||
public StencilOp FrontDpFail;
|
||||
|
@ -434,7 +439,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public int FrontFuncRef;
|
||||
public int FrontFuncMask;
|
||||
public int FrontMask;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -452,11 +457,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct RgbHalf
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint R;
|
||||
public uint G;
|
||||
public uint B;
|
||||
public uint Padding;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Unpacks the red color component as a 16-bit float value.
|
||||
|
@ -506,10 +512,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct PoolState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public GpuVa Address;
|
||||
public int MaximumId;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -517,13 +523,13 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct StencilBackTestState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 TwoSided;
|
||||
public StencilOp BackSFail;
|
||||
public StencilOp BackDpFail;
|
||||
public StencilOp BackDpPass;
|
||||
public CompareOp BackFunc;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -531,10 +537,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct PrimitiveRestartState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 Enable;
|
||||
public int Index;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -543,12 +549,12 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct IndexBufferState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public GpuVa Address;
|
||||
public GpuVa EndAddress;
|
||||
public IndexType Type;
|
||||
public int First;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -556,11 +562,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct FaceState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 CullEnable;
|
||||
public FrontFace FrontFace;
|
||||
public Face CullFace;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -578,10 +584,10 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct LogicalOpState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 Enable;
|
||||
public LogicalOp LogicalOp;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -639,10 +645,11 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct VertexBufferState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint Control;
|
||||
public GpuVa Address;
|
||||
public int Divisor;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Vertex buffer stride, defined as the number of bytes occupied by each vertex in memory.
|
||||
|
@ -668,7 +675,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct BlendStateCommon
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 SeparateAlpha;
|
||||
public BlendOp ColorOp;
|
||||
public BlendFactor ColorSrcFactor;
|
||||
|
@ -677,7 +684,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public BlendFactor AlphaSrcFactor;
|
||||
public uint Unknown0x1354;
|
||||
public BlendFactor AlphaDstFactor;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -685,7 +692,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct BlendState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public Boolean32 SeparateAlpha;
|
||||
public BlendOp ColorOp;
|
||||
public BlendFactor ColorSrcFactor;
|
||||
|
@ -694,7 +701,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public BlendFactor AlphaSrcFactor;
|
||||
public BlendFactor AlphaDstFactor;
|
||||
public uint Padding;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -702,7 +709,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct ShaderState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint Control;
|
||||
public uint Offset;
|
||||
public uint Unknown0x8;
|
||||
|
@ -719,6 +726,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public uint Unknown0x34;
|
||||
public uint Unknown0x38;
|
||||
public uint Unknown0x3c;
|
||||
#pragma warning restore CS0649
|
||||
|
||||
/// <summary>
|
||||
/// Unpacks shader enable information.
|
||||
|
@ -736,16 +744,16 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
/// </summary>
|
||||
struct UniformBufferState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public int Size;
|
||||
public GpuVa Address;
|
||||
public int Offset;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
|
||||
unsafe struct ThreedClassState : IShadowState
|
||||
{
|
||||
|
||||
#pragma warning disable CS0649 // Field is never assigned to
|
||||
public uint SetObject;
|
||||
public readonly int SetObjectClassId => (int)(SetObject & 0xFFFF);
|
||||
public readonly int SetObjectEngineId => (int)((SetObject >> 16) & 0x1F);
|
||||
|
@ -1044,6 +1052,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
|
|||
public Array4<Array32<uint>> TfVaryingLocations;
|
||||
public fixed uint Reserved2A00[640];
|
||||
public Array256<uint> SetMmeShadowScratch;
|
||||
|
||||
#pragma warning restore CS0649
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue