[Ryujinx.Graphics.Gpu] Address dotnet-format issues (#5367)

* dotnet format style --severity info

Some changes were manually reverted.

* dotnet format analyzers --serverity info

Some changes have been minimally adapted.

* Restore a few unused methods and variables

* Silence dotnet format IDE0060 warnings

* Silence dotnet format IDE0052 warnings

* Address dotnet format CA1816 warnings

* Address or silence dotnet format CA1069 warnings

* Address or silence dotnet format CA2211 warnings

* Address remaining dotnet format analyzer warnings

* Address review comments

* Address most dotnet format whitespace warnings

* Apply dotnet format whitespace formatting

A few of them have been manually reverted and the corresponding warning was silenced

* Format if-blocks correctly

* Run dotnet format whitespace after rebase

* Run dotnet format style after rebase

* Another rebase, another dotnet format run

* Run dotnet format style after rebase

* Run dotnet format after rebase and remove unused usings

- analyzers
- style
- whitespace

* Disable 'prefer switch expression' rule

* Add comments to disabled warnings

* Remove a few unused parameters

* Replace MmeShadowScratch with Array256<uint>

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Start working on disabled warnings

* Fix and silence a few dotnet-format warnings again

* Run dotnet format after rebase

* Address IDE0251 warnings

* Silence IDE0060 in .editorconfig

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* First pass of dotnet format

* Add unsafe dotnet format changes

* Fix typos

* Add trailing commas

* Disable formatting for FormatTable

* Address review feedback
This commit is contained in:
TSRBerry 2023-07-02 02:47:54 +02:00 committed by GitHub
parent 2457cfc911
commit 3b46bb73f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
145 changed files with 1445 additions and 1427 deletions

View file

@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
Max = 3,
Rcp = 4,
Add = 5,
Sub = 6
Sub = 6,
}
/// <summary>
@ -29,7 +29,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
LT = 4,
LE = 5,
GT = 6,
GE = 7
GE = 7,
}
/// <summary>
@ -49,7 +49,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
Temp1 = 0xa,
Temp2 = 0xb,
PBR = 0xc,
ConstantRGB = 0xd
ConstantRGB = 0xd,
}
/// <summary>
@ -64,7 +64,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
Temp0 = 4,
Temp1 = 5,
Temp2 = 6,
PBR = 7
PBR = 7,
}
/// <summary>
@ -75,7 +75,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
Temp0 = 0,
Temp1 = 1,
Temp2 = 2,
PBR = 3
PBR = 3,
}
/// <summary>
@ -88,7 +88,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
RRR = 2,
GGG = 3,
BBB = 4,
RToA = 5
RToA = 5,
}
/// <summary>
@ -99,13 +99,13 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
RGB = 0,
R = 1,
G = 2,
B = 3
B = 3,
}
/// <summary>
/// Floating-point RGB color values.
/// </summary>
struct RgbFloat
readonly struct RgbFloat
{
/// <summary>
/// Red component value.
@ -139,24 +139,24 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
/// <summary>
/// Blend microcode destination operand, including swizzle, write mask and condition code update flag.
/// </summary>
struct Dest
readonly struct Dest
{
public static Dest Temp0 => new Dest(OpDst.Temp0, Swizzle.RGB, WriteMask.RGB, false);
public static Dest Temp1 => new Dest(OpDst.Temp1, Swizzle.RGB, WriteMask.RGB, false);
public static Dest Temp2 => new Dest(OpDst.Temp2, Swizzle.RGB, WriteMask.RGB, false);
public static Dest PBR => new Dest(OpDst.PBR, Swizzle.RGB, WriteMask.RGB, false);
public static Dest Temp0 => new(OpDst.Temp0, Swizzle.RGB, WriteMask.RGB, false);
public static Dest Temp1 => new(OpDst.Temp1, Swizzle.RGB, WriteMask.RGB, false);
public static Dest Temp2 => new(OpDst.Temp2, Swizzle.RGB, WriteMask.RGB, false);
public static Dest PBR => new(OpDst.PBR, Swizzle.RGB, WriteMask.RGB, false);
public Dest GBR => new Dest(Dst, Swizzle.GBR, WriteMask, WriteCC);
public Dest RRR => new Dest(Dst, Swizzle.RRR, WriteMask, WriteCC);
public Dest GGG => new Dest(Dst, Swizzle.GGG, WriteMask, WriteCC);
public Dest BBB => new Dest(Dst, Swizzle.BBB, WriteMask, WriteCC);
public Dest RToA => new Dest(Dst, Swizzle.RToA, WriteMask, WriteCC);
public Dest GBR => new(Dst, Swizzle.GBR, WriteMask, WriteCC);
public Dest RRR => new(Dst, Swizzle.RRR, WriteMask, WriteCC);
public Dest GGG => new(Dst, Swizzle.GGG, WriteMask, WriteCC);
public Dest BBB => new(Dst, Swizzle.BBB, WriteMask, WriteCC);
public Dest RToA => new(Dst, Swizzle.RToA, WriteMask, WriteCC);
public Dest R => new Dest(Dst, Swizzle, WriteMask.R, WriteCC);
public Dest G => new Dest(Dst, Swizzle, WriteMask.G, WriteCC);
public Dest B => new Dest(Dst, Swizzle, WriteMask.B, WriteCC);
public Dest R => new(Dst, Swizzle, WriteMask.R, WriteCC);
public Dest G => new(Dst, Swizzle, WriteMask.G, WriteCC);
public Dest B => new(Dst, Swizzle, WriteMask.B, WriteCC);
public Dest CC => new Dest(Dst, Swizzle, WriteMask, true);
public Dest CC => new(Dst, Swizzle, WriteMask, true);
public OpDst Dst { get; }
public Swizzle Swizzle { get; }
@ -182,7 +182,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
/// <summary>
/// Blend microcode operaiton.
/// </summary>
struct UcodeOp
readonly struct UcodeOp
{
public readonly uint Word;
@ -292,14 +292,14 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender
_constantIndex = index;
}
public uint[] GetCode()
public readonly uint[] GetCode()
{
return _code?.ToArray();
}
public RgbFloat[] GetConstants()
public readonly RgbFloat[] GetConstants()
{
return _constants;
}
}
}
}