Prefer using collection expressions with implicit object creation when the type is clear

This commit is contained in:
Marco Carvalho
2024-12-27 13:23:31 -03:00
parent 850df38f1e
commit 57d1486da9
510 changed files with 6022 additions and 6212 deletions

View File

@@ -1242,11 +1242,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
if (hasDerivatives)
{
derivatives = new[]
{
derivatives =
[
AssembleDerivativesVector(coordsCount), // dPdx
AssembleDerivativesVector(coordsCount), // dPdy
};
];
}
SpvInstruction sample = null;
@@ -1286,17 +1286,17 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
if (hasOffset)
{
offsets = new[] { AssembleOffsetVector(coordsCount) };
offsets = [AssembleOffsetVector(coordsCount)];
}
else if (hasOffsets)
{
offsets = new[]
{
offsets =
[
AssembleOffsetVector(coordsCount),
AssembleOffsetVector(coordsCount),
AssembleOffsetVector(coordsCount),
AssembleOffsetVector(coordsCount),
};
];
}
SpvInstruction lodBias = null;
@@ -1327,7 +1327,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
compIdx = Src(AggregateType.S32);
}
var operandsList = new List<SpvInstruction>();
List<SpvInstruction> operandsList = [];
var operandsMask = ImageOperandsMask.MaskNone;
if (hasLodBias)