[Ryujinx.Graphics.GAL] Address dotnet-format issues (#5366)

* 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 IDE0052 warnings

* Address dotnet format CA1816 warnings

* Address or silence dotnet format CA1069 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

* Revert formatting changes for while and for-loops

* Another rebase, another dotnet format run

* Run dotnet format whitespace after rebase

* Run dotnet format style after rebase

* Run dotnet format analyzers after rebase

* Run dotnet format after rebase and remove unused usings

- analyzers
- style
- whitespace

* Disable 'prefer switch expression' rule

* Add comments to disabled warnings

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

* Start working on disabled warnings

* Address IDE0251 warnings

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

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* First dotnet format pass

* Address review feedback

* Add trailing commas

* Remove SuppressMessage for IDE0066

* Make explicit Equals implementation implicit
This commit is contained in:
TSRBerry 2023-06-28 20:20:10 +02:00 committed by GitHub
parent 16fa983704
commit 7c989f88bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
161 changed files with 481 additions and 439 deletions

View file

@ -12,7 +12,7 @@ namespace Ryujinx.Graphics.GAL
TextureAndSampler,
Image,
BufferTexture,
BufferImage
BufferImage,
}
public enum ResourceAccess : byte
@ -20,7 +20,7 @@ namespace Ryujinx.Graphics.GAL
None = 0,
Read = 1,
Write = 2,
ReadWrite = Read | Write
ReadWrite = Read | Write,
}
[Flags]
@ -32,7 +32,7 @@ namespace Ryujinx.Graphics.GAL
TessellationControl = 1 << 2,
TessellationEvaluation = 1 << 3,
Geometry = 1 << 4,
Fragment = 1 << 5
Fragment = 1 << 5,
}
public readonly struct ResourceDescriptor : IEquatable<ResourceDescriptor>
@ -64,6 +64,16 @@ namespace Ryujinx.Graphics.GAL
{
return Binding == other.Binding && Count == other.Count && Type == other.Type && Stages == other.Stages;
}
public static bool operator ==(ResourceDescriptor left, ResourceDescriptor right)
{
return left.Equals(right);
}
public static bool operator !=(ResourceDescriptor left, ResourceDescriptor right)
{
return !(left == right);
}
}
public readonly struct ResourceUsage : IEquatable<ResourceUsage>
@ -95,6 +105,16 @@ namespace Ryujinx.Graphics.GAL
{
return Binding == other.Binding && Type == other.Type && Stages == other.Stages && Access == other.Access;
}
public static bool operator ==(ResourceUsage left, ResourceUsage right)
{
return left.Equals(right);
}
public static bool operator !=(ResourceUsage left, ResourceUsage right)
{
return !(left == right);
}
}
public readonly struct ResourceDescriptorCollection
@ -108,7 +128,7 @@ namespace Ryujinx.Graphics.GAL
public override int GetHashCode()
{
HashCode hasher = new HashCode();
HashCode hasher = new();
if (Descriptors != null)
{
@ -151,6 +171,16 @@ namespace Ryujinx.Graphics.GAL
return true;
}
public static bool operator ==(ResourceDescriptorCollection left, ResourceDescriptorCollection right)
{
return left.Equals(right);
}
public static bool operator !=(ResourceDescriptorCollection left, ResourceDescriptorCollection right)
{
return !(left == right);
}
}
public readonly struct ResourceUsageCollection