aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs')
-rw-r--r--src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs b/src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs
index e6c3f6e7..3f69cb4c 100644
--- a/src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs
+++ b/src/Ryujinx.Graphics.Texture/Utils/BC67Utils.cs
@@ -8,8 +8,8 @@ namespace Ryujinx.Graphics.Texture.Utils
{
static class BC67Utils
{
- private static byte[][] _quantizationLut;
- private static byte[][] _quantizationLutNoPBit;
+ private static readonly byte[][] _quantizationLut;
+ private static readonly byte[][] _quantizationLutNoPBit;
static BC67Utils()
{
@@ -46,7 +46,7 @@ namespace Ryujinx.Graphics.Texture.Utils
}
else
{
- RgbaColor8 minColor = new RgbaColor8(255, 255, 255, 255);
+ RgbaColor8 minColor = new(255, 255, 255, 255);
RgbaColor8 maxColor = default;
for (int i = 0; i < tile.Length; i++)
@@ -1176,8 +1176,8 @@ namespace Ryujinx.Graphics.Texture.Utils
int weight = (((weightIndex << 7) / ((1 << indexBitCount) - 1)) + 1) >> 1;
- RgbaColor32 weightV = new RgbaColor32(weight);
- RgbaColor32 invWeightV = new RgbaColor32(64 - weight);
+ RgbaColor32 weightV = new(weight);
+ RgbaColor32 invWeightV = new(64 - weight);
return (color1 * invWeightV + color2 * weightV + new RgbaColor32(32)) >> 6;
}
@@ -1197,8 +1197,10 @@ namespace Ryujinx.Graphics.Texture.Utils
int colorWeight = BC67Tables.Weights[colorIndexBitCount - 2][colorWeightIndex];
int alphaWeight = BC67Tables.Weights[alphaIndexBitCount - 2][alphaWeightIndex];
- RgbaColor32 weightV = new RgbaColor32(colorWeight);
- weightV.A = alphaWeight;
+ RgbaColor32 weightV = new(colorWeight)
+ {
+ A = alphaWeight
+ };
RgbaColor32 invWeightV = new RgbaColor32(64) - weightV;
return (color1 * invWeightV + color2 * weightV + new RgbaColor32(32)) >> 6;