misc: chore: Use collection expressions in Shader project
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
Type = type;
|
||||
Condition = condition;
|
||||
|
||||
_nodes = new LinkedList<IAstNode>();
|
||||
_nodes = [];
|
||||
}
|
||||
|
||||
public void Add(IAstNode node)
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
private AstOperand()
|
||||
{
|
||||
Defs = new HashSet<IAstNode>();
|
||||
Uses = new HashSet<IAstNode>();
|
||||
Defs = [];
|
||||
Uses = [];
|
||||
|
||||
VarType = AggregateType.S32;
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
{
|
||||
AstBlock block = bottom;
|
||||
|
||||
List<AstBlock> path = new();
|
||||
List<AstBlock> path = [];
|
||||
|
||||
while (block != top)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
InArguments = inArguments;
|
||||
OutArguments = outArguments;
|
||||
|
||||
Locals = new HashSet<AstOperand>();
|
||||
Locals = [];
|
||||
}
|
||||
|
||||
public AggregateType GetArgumentType(int index)
|
||||
|
||||
@@ -237,7 +237,8 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
dest.VarType = destElemType;
|
||||
|
||||
context.AddNode(new AstAssignment(dest, new AstOperation(Instruction.VectorExtract, StorageKind.None, false, new[] { destVec, index }, 2)));
|
||||
context.AddNode(new AstAssignment(dest, new AstOperation(Instruction.VectorExtract, StorageKind.None, false,
|
||||
[destVec, index], 2)));
|
||||
}
|
||||
}
|
||||
else if (operation.Dest != null)
|
||||
@@ -354,7 +355,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
private static AggregateType GetVarTypeFromUses(Operand dest)
|
||||
{
|
||||
HashSet<Operand> visited = new();
|
||||
HashSet<Operand> visited = [];
|
||||
|
||||
Queue<Operand> pending = new();
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
AggregateType[] inArguments,
|
||||
AggregateType[] outArguments)
|
||||
{
|
||||
_loopTails = new HashSet<BasicBlock>();
|
||||
_loopTails = [];
|
||||
|
||||
_blockStack = new Stack<(AstBlock, int, int)>();
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
_gotoTempAsgs = new Dictionary<int, AstAssignment>();
|
||||
|
||||
_gotos = new List<GotoStatement>();
|
||||
_gotos = [];
|
||||
|
||||
_currBlock = new AstBlock(AstBlockType.Main);
|
||||
|
||||
@@ -314,13 +314,13 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
ResourceManager.SetUsedConstantBufferBinding(binding);
|
||||
|
||||
IAstNode[] sources = new IAstNode[]
|
||||
{
|
||||
IAstNode[] sources =
|
||||
[
|
||||
new AstOperand(OperandType.Constant, binding),
|
||||
new AstOperand(OperandType.Constant, 0),
|
||||
new AstOperand(OperandType.Constant, vecIndex),
|
||||
new AstOperand(OperandType.Constant, elemIndex),
|
||||
};
|
||||
new AstOperand(OperandType.Constant, elemIndex)
|
||||
];
|
||||
|
||||
return new AstOperation(Instruction.Load, StorageKind.ConstantBuffer, false, sources, sources.Length);
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
||||
|
||||
public StructuredProgramInfo(bool precise)
|
||||
{
|
||||
Functions = new List<StructuredFunction>();
|
||||
Functions = [];
|
||||
|
||||
IoDefinitions = new HashSet<IoDefinition>();
|
||||
IoDefinitions = [];
|
||||
|
||||
if (precise)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user