mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-25 01:57:11 +02:00
misc: chore: Use collection expressions in Shader project
This commit is contained in:
parent
a5dbcb75d0
commit
95f9e548ca
38 changed files with 198 additions and 204 deletions
|
@ -50,7 +50,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
private class BlockState
|
||||
{
|
||||
private int _entryCount;
|
||||
private readonly List<Instruction> _labels = new();
|
||||
private readonly List<Instruction> _labels = [];
|
||||
|
||||
public Instruction GetNextLabel(CodeGenContext context)
|
||||
{
|
||||
|
@ -147,7 +147,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
|
||||
public Instruction[] GetMainInterface()
|
||||
{
|
||||
List<Instruction> mainInterface = new();
|
||||
List<Instruction> mainInterface = [];
|
||||
|
||||
mainInterface.AddRange(Inputs.Values);
|
||||
mainInterface.AddRange(Outputs.Values);
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
|
||||
private static void DeclareBuffers(CodeGenContext context, IEnumerable<BufferDefinition> buffers, bool isBuffer)
|
||||
{
|
||||
HashSet<SpvInstruction> decoratedTypes = new();
|
||||
HashSet<SpvInstruction> decoratedTypes = [];
|
||||
|
||||
foreach (BufferDefinition buffer in buffers)
|
||||
{
|
||||
|
|
|
@ -1242,11 +1242,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
|
||||
if (hasDerivatives)
|
||||
{
|
||||
derivatives = new[]
|
||||
{
|
||||
derivatives =
|
||||
[
|
||||
AssembleDerivativesVector(coordsCount), // dPdx
|
||||
AssembleDerivativesVector(coordsCount), // dPdy
|
||||
};
|
||||
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),
|
||||
};
|
||||
AssembleOffsetVector(coordsCount)
|
||||
];
|
||||
}
|
||||
|
||||
SpvInstruction lodBias = null;
|
||||
|
@ -1327,7 +1327,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
|
|||
compIdx = Src(AggregateType.S32);
|
||||
}
|
||||
|
||||
List<SpvInstruction> operandsList = new();
|
||||
List<SpvInstruction> operandsList = [];
|
||||
ImageOperandsMask operandsMask = ImageOperandsMask.MaskNone;
|
||||
|
||||
if (hasLodBias)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue