misc: chore: Use collection expressions everywhere else (except VP9)

This commit is contained in:
Evan Husted
2025-01-26 15:59:11 -06:00
parent 0f857400b6
commit ac838aa81d
59 changed files with 3246 additions and 2452 deletions

View File

@@ -1693,12 +1693,12 @@ namespace Ryujinx.Graphics.Texture.Astc
if (h)
{
ReadOnlySpan<byte> maxWeights = new byte[] { 9, 11, 15, 19, 23, 31 };
ReadOnlySpan<byte> maxWeights = [9, 11, 15, 19, 23, 31];
texelParams.MaxWeight = maxWeights[r - 2];
}
else
{
ReadOnlySpan<byte> maxWeights = new byte[] { 1, 2, 3, 4, 5, 7 };
ReadOnlySpan<byte> maxWeights = [1, 2, 3, 4, 5, 7];
texelParams.MaxWeight = maxWeights[r - 2];
}

View File

@@ -129,7 +129,7 @@ namespace Ryujinx.Graphics.Texture.Astc
ref IntegerSequence listIntegerEncoded,
int numberBitsPerValue)
{
ReadOnlySpan<byte> interleavedBits = new byte[] { 3, 2, 2 };
ReadOnlySpan<byte> interleavedBits = [3, 2, 2];
// Implement the algorithm in section C.2.12
Span<int> m = stackalloc int[3];
@@ -213,8 +213,8 @@ namespace Ryujinx.Graphics.Texture.Astc
return QuintEncodings.Slice(index * 3, 3);
}
private static ReadOnlySpan<byte> TritEncodings => new byte[]
{
private static ReadOnlySpan<byte> TritEncodings =>
[
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0,
2, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0,
@@ -300,11 +300,11 @@ namespace Ryujinx.Graphics.Texture.Astc
2, 1, 1, 1, 2, 1, 1, 2, 1, 2, 0, 2, 1, 1, 2,
1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 1, 2, 1, 2,
0, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 1, 2, 2, 2,
};
2, 1, 2, 2, 2
];
private static ReadOnlySpan<byte> QuintEncodings => new byte[]
{
private static ReadOnlySpan<byte> QuintEncodings =>
[
0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0,
0, 4, 0, 4, 4, 0, 4, 4, 4, 0, 1, 0, 1, 1, 0,
2, 1, 0, 3, 1, 0, 4, 1, 0, 1, 4, 0, 4, 4, 1,
@@ -330,7 +330,7 @@ namespace Ryujinx.Graphics.Texture.Astc
0, 1, 4, 1, 1, 4, 0, 2, 3, 1, 2, 3, 2, 2, 3,
3, 2, 3, 4, 2, 3, 2, 4, 3, 0, 2, 4, 1, 2, 4,
0, 3, 3, 1, 3, 3, 2, 3, 3, 3, 3, 3, 4, 3, 3,
3, 4, 3, 0, 3, 4, 1, 3, 4,
};
3, 4, 3, 0, 3, 4, 1, 3, 4
];
}
}