diff options
| author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-06-28 09:26:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-28 09:26:39 +0200 |
| commit | 6aa8d71588af4615019cd91b8a31f69dbfaa815d (patch) | |
| tree | 4b60ed9aeb846ca3bf50f1e9dac97ddfdbc269de /src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs | |
| parent | 9becbd7d728fc2002c176dfd9d1d1aae86f86b12 (diff) | |
[Ryujinx.Graphics.Nvdec.Vp9] Address dotnet-format issues (#5371)
* 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
* Address or silence dotnet format IDE1006 warnings
* 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
* Add comments to disabled warnings
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Address IDE0251 warnings
* Address a few disabled IDE0060 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
* Fix empty lines before return
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Add trailing commas, remove redundant code and remove static modifier from Surface.HighBd
* Fix naming rule violations
* Fix naming rule violations
* Fix empty line before return
* Fix comment style
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Remove comment alignment
* Address review feedback
* Separate comments by 2 spaces and fix other formatting issues
* Make HighBd an auto-property
* Replace if-chain with if-else-chain
* Fix new naming rule violations
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs b/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs index 53d1f2cc..c0fbdc51 100644 --- a/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs +++ b/src/Ryujinx.Graphics.Nvdec.Vp9/Types/Segmentation.cs @@ -6,8 +6,8 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types { internal struct Segmentation { - private static readonly int[] SegFeatureDataSigned = new int[] { 1, 1, 0, 0 }; - private static readonly int[] SegFeatureDataMax = new int[] { QuantCommon.MaxQ, Vp9.LoopFilter.MaxLoopFilter, 3, 0 }; + private static readonly int[] _segFeatureDataSigned = { 1, 1, 0, 0 }; + private static readonly int[] _segFeatureDataMax = { QuantCommon.MaxQ, Vp9.LoopFilter.MaxLoopFilter, 3, 0 }; public bool Enabled; public bool UpdateMap; @@ -26,8 +26,8 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types public void ClearAllSegFeatures() { - MemoryMarshal.CreateSpan(ref FeatureData[0][0], 8 * 4).Fill(0); - MemoryMarshal.CreateSpan(ref FeatureMask[0], 8).Fill(0); + MemoryMarshal.CreateSpan(ref FeatureData[0][0], 8 * 4).Clear(); + MemoryMarshal.CreateSpan(ref FeatureMask[0], 8).Clear(); AqAvOffset = 0; } @@ -38,21 +38,21 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types internal static int FeatureDataMax(SegLvlFeatures featureId) { - return SegFeatureDataMax[(int)featureId]; + return _segFeatureDataMax[(int)featureId]; } internal static int IsSegFeatureSigned(SegLvlFeatures featureId) { - return SegFeatureDataSigned[(int)featureId]; + return _segFeatureDataSigned[(int)featureId]; } internal void SetSegData(int segmentId, SegLvlFeatures featureId, int segData) { - Debug.Assert(segData <= SegFeatureDataMax[(int)featureId]); + Debug.Assert(segData <= _segFeatureDataMax[(int)featureId]); if (segData < 0) { - Debug.Assert(SegFeatureDataSigned[(int)featureId] != 0); - Debug.Assert(-segData <= SegFeatureDataMax[(int)featureId]); + Debug.Assert(_segFeatureDataSigned[(int)featureId] != 0); + Debug.Assert(-segData <= _segFeatureDataMax[(int)featureId]); } FeatureData[segmentId][(int)featureId] = (short)segData; |
