mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-06 04:19:15 +00:00
misc: chore: Use collection expressions in Shader project
This commit is contained in:
@@ -45,11 +45,11 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
{
|
||||
Address = address;
|
||||
|
||||
Predecessors = new List<Block>();
|
||||
Successors = new List<Block>();
|
||||
Predecessors = [];
|
||||
Successors = [];
|
||||
|
||||
OpCodes = new List<InstOp>();
|
||||
PushOpCodes = new List<PushOpInfo>();
|
||||
OpCodes = [];
|
||||
PushOpCodes = [];
|
||||
SyncTargets = new Dictionary<ulong, SyncTarget>();
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
public DecodedFunction(ulong address)
|
||||
{
|
||||
Address = address;
|
||||
_callers = new HashSet<DecodedFunction>();
|
||||
_callers = [];
|
||||
Type = FunctionType.User;
|
||||
Id = -1;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
{
|
||||
MainFunction = mainFunction;
|
||||
_functions = functions;
|
||||
_functionsWithId = new();
|
||||
_functionsWithId = [];
|
||||
AttributeUsage = attributeUsage;
|
||||
UsedFeatures = usedFeatures;
|
||||
ClipDistancesWritten = clipDistancesWritten;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
|
||||
while (functionsQueue.TryDequeue(out DecodedFunction currentFunction))
|
||||
{
|
||||
List<Block> blocks = new();
|
||||
List<Block> blocks = [];
|
||||
Queue<Block> workQueue = new();
|
||||
Dictionary<ulong, Block> visited = new();
|
||||
|
||||
@@ -520,7 +520,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
|
||||
if (lastOp.Name == InstName.Brx && block.Successors.Count == (hasNext ? 1 : 0))
|
||||
{
|
||||
HashSet<ulong> visited = new();
|
||||
HashSet<ulong> visited = [];
|
||||
|
||||
InstBrx opBrx = new(lastOp.RawOpCode);
|
||||
ulong baseOffset = lastOp.GetAbsoluteAddress();
|
||||
@@ -566,7 +566,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
// On a successful match, "BaseOffset" is the offset in bytes where the jump offsets are
|
||||
// located on the constant buffer, and "UpperBound" is the total number of offsets for the BRX, minus 1.
|
||||
|
||||
HashSet<Block> visited = new();
|
||||
HashSet<Block> visited = [];
|
||||
|
||||
BlockLocation ldcLocation = FindFirstRegWrite(visited, new BlockLocation(block, block.OpCodes.Count - 1), brxReg);
|
||||
if (ldcLocation.Block == null || ldcLocation.Block.OpCodes[ldcLocation.Index].Name != InstName.Ldc)
|
||||
@@ -752,7 +752,7 @@ namespace Ryujinx.Graphics.Shader.Decoders
|
||||
Block target = blocks[pushOp.GetAbsoluteAddress()];
|
||||
|
||||
Stack<PathBlockState> workQueue = new();
|
||||
HashSet<Block> visited = new();
|
||||
HashSet<Block> visited = [];
|
||||
Stack<(ulong, MergeType)> branchStack = new();
|
||||
|
||||
void Push(PathBlockState pbs)
|
||||
|
||||
Reference in New Issue
Block a user