Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)

See merge request ryubing/ryujinx!47
This commit is contained in:
MrKev 2025-06-11 17:58:27 -05:00 committed by LotP
parent d03ae9c164
commit ea027d65a7
309 changed files with 1018 additions and 1247 deletions

View file

@ -4,7 +4,7 @@ namespace Ryujinx.Graphics.Nvdec
{
struct NvdecRegisters
{
#pragma warning disable CS0649 // Field is never assigned to
public Array64<uint> Reserved0;
public uint Nop;
public Array63<uint> Reserved104;
@ -58,6 +58,6 @@ namespace Ryujinx.Graphics.Nvdec
public uint Vp9SetColMvWriteBufOffset;
public uint Vp9SetColMvReadBufOffset;
public uint Vp9SetFilterBufferOffset;
#pragma warning restore CS0649
}
}

View file

@ -4,13 +4,13 @@ namespace Ryujinx.Graphics.Nvdec
{
struct NvdecStatus
{
#pragma warning disable CS0649 // Field is never assigned to
public uint MbsCorrectlyDecoded;
public uint MbsInError;
public uint Reserved;
public uint ErrorStatus;
public FrameStats Stats;
public uint SliceHeaderErrorCode;
#pragma warning restore CS0649
}
}

View file

@ -1,13 +1,14 @@
using Ryujinx.Common.Memory;
using Ryujinx.Graphics.Video;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.Nvdec.Types.H264
{
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct PictureInfo
{
#pragma warning disable IDE0051, CS0169, CS0649 // Remove unused private member
Array18<uint> Unknown0;
#pragma warning restore IDE0051
public uint BitstreamSize;
public uint NumSlices;
public uint Unknown50;
@ -49,7 +50,6 @@ namespace Ryujinx.Graphics.Nvdec.Types.H264
public Array16<byte> MvcextViewRefMasksL1;
public uint Flags2;
public Array10<uint> Unknown2D4;
#pragma warning restore CS0169, CS0649
public readonly bool MbAdaptiveFrameFieldFlag => (Flags & (1 << 0)) != 0;
public readonly bool Direct8x8InferenceFlag => (Flags & (1 << 1)) != 0;

View file

@ -4,11 +4,10 @@ namespace Ryujinx.Graphics.Nvdec.Types.H264
{
struct ReferenceFrame
{
#pragma warning disable CS0649 // Field is never assigned to
public uint Flags;
public Array2<uint> FieldOrderCnt;
public uint FrameNum;
#pragma warning restore CS0649
public readonly uint OutputSurfaceIndex => (uint)Flags & 0x7f;
}

View file

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp8
{
struct PictureInfo
{
#pragma warning disable CS0649 // Field is never assigned to
public Array13<uint> Unknown0;
public uint GpTimerTimeoutValue;
public ushort FrameWidth;
@ -58,7 +58,6 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp8
public uint ResultValue; // ucode return result
public Array8<uint> PartitionOffset;
public Array3<uint> Reserved4;
#pragma warning restore CS0649
public Vp8PictureInfo Convert()
{

View file

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
{
struct EntropyProbs
{
#pragma warning disable CS0649 // Field is never assigned to
public Array10<Array10<Array8<byte>>> KfYModeProbE0ToE7;
public Array10<Array10<byte>> KfYModeProbE8;
public Array3<byte> Padding384;
@ -42,7 +42,6 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
public Array5<byte> CompRefProb;
public Array17<byte> Padding58F;
public Array4<Array2<Array2<Array6<Array6<Array4<byte>>>>>> CoefProbs;
#pragma warning restore CS0649
public void Convert(ref Vp9EntropyProbs fc)
{

View file

@ -2,11 +2,11 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
{
struct FrameSize
{
#pragma warning disable CS0649 // Field is never assigned to
public ushort Width;
public ushort Height;
public ushort LumaPitch;
public ushort ChromaPitch;
#pragma warning restore CS0649
}
}

View file

@ -2,7 +2,7 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
{
struct FrameStats
{
#pragma warning disable CS0649 // Field is never assigned to
public uint Unknown0;
public uint Unknown4;
public uint Pass2CycleCount;
@ -16,6 +16,6 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
public uint FrameStatusBwdMvyCnt;
public uint ErrorCtbPos;
public uint ErrorSlicePos;
#pragma warning restore CS0649
}
}

View file

@ -4,10 +4,10 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
{
struct LoopFilter
{
#pragma warning disable CS0649 // Field is never assigned to
public byte ModeRefDeltaEnabled;
public Array4<sbyte> RefDeltas;
public Array2<sbyte> ModeDeltas;
#pragma warning restore CS0649
}
}

View file

@ -5,7 +5,7 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
{
struct PictureInfo
{
#pragma warning disable CS0649 // Field is never assigned to
public Array12<uint> Unknown0;
public uint BitstreamSize;
public uint IsEncrypted;
@ -42,7 +42,6 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
public uint UnknownF4;
public uint UnknownF8;
public uint UnknownFC;
#pragma warning restore CS0649
public readonly uint BitDepth => (SurfaceParams >> 1) & 0xf;

View file

@ -4,13 +4,13 @@ namespace Ryujinx.Graphics.Nvdec.Types.Vp9
{
struct Segmentation
{
#pragma warning disable CS0649 // Field is never assigned to
public byte Enabled;
public byte UpdateMap;
public byte TemporalUpdate;
public byte AbsDelta;
public Array8<uint> FeatureMask;
public Array8<Array4<short>> FeatureData;
#pragma warning restore CS0649
}
}