mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-25 23:37:11 +02:00
misc: chore: Use collection expressions everywhere else (except VP9)
This commit is contained in:
parent
0f857400b6
commit
ac838aa81d
59 changed files with 3246 additions and 2452 deletions
|
@ -149,7 +149,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
{
|
||||
if (entry.DependencyList == null)
|
||||
{
|
||||
entry.DependencyList = new List<Dependency>();
|
||||
entry.DependencyList = [];
|
||||
entries[i] = entry;
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
DestroyEntry(entry);
|
||||
}
|
||||
|
||||
(toRemove ??= new List<ulong>()).Add(range.Key);
|
||||
(toRemove ??= []).Add(range.Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
if (!_ranges.TryGetValue(key, out List<Entry> value))
|
||||
{
|
||||
value = new List<Entry>();
|
||||
value = [];
|
||||
_ranges.Add(key, value);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public void Initialize()
|
||||
{
|
||||
Dependants = new List<IAuto>();
|
||||
Waitables = new List<MultiFenceHolder>();
|
||||
Dependants = [];
|
||||
Waitables = [];
|
||||
Encoders = new CommandBufferEncoder();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ namespace Ryujinx.Graphics.Metal
|
|||
{
|
||||
public struct RenderEncoderBindings
|
||||
{
|
||||
public List<Resource> Resources = new();
|
||||
public List<BufferResource> VertexBuffers = new();
|
||||
public List<BufferResource> FragmentBuffers = new();
|
||||
public List<Resource> Resources = [];
|
||||
public List<BufferResource> VertexBuffers = [];
|
||||
public List<BufferResource> FragmentBuffers = [];
|
||||
|
||||
public RenderEncoderBindings() { }
|
||||
|
||||
|
@ -21,8 +21,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public struct ComputeEncoderBindings
|
||||
{
|
||||
public List<Resource> Resources = new();
|
||||
public List<BufferResource> Buffers = new();
|
||||
public List<Resource> Resources = [];
|
||||
public List<BufferResource> Buffers = [];
|
||||
|
||||
public ComputeEncoderBindings() { }
|
||||
|
||||
|
|
|
@ -89,10 +89,10 @@ namespace Ryujinx.Graphics.Metal
|
|||
}
|
||||
else
|
||||
{
|
||||
bucket.Entries = new[]
|
||||
{
|
||||
entry,
|
||||
};
|
||||
bucket.Entries =
|
||||
[
|
||||
entry
|
||||
];
|
||||
}
|
||||
|
||||
bucket.Length++;
|
||||
|
|
|
@ -27,9 +27,9 @@ namespace Ryujinx.Graphics.Metal
|
|||
private readonly IProgram _programColorBlitMsF;
|
||||
private readonly IProgram _programColorBlitMsI;
|
||||
private readonly IProgram _programColorBlitMsU;
|
||||
private readonly List<IProgram> _programsColorClearF = new();
|
||||
private readonly List<IProgram> _programsColorClearI = new();
|
||||
private readonly List<IProgram> _programsColorClearU = new();
|
||||
private readonly List<IProgram> _programsColorClearF = [];
|
||||
private readonly List<IProgram> _programsColorClearI = [];
|
||||
private readonly List<IProgram> _programsColorClearU = [];
|
||||
private readonly IProgram _programDepthStencilClear;
|
||||
private readonly IProgram _programStrideChange;
|
||||
private readonly IProgram _programConvertD32S8ToD24S8;
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public IdList()
|
||||
{
|
||||
_list = new List<T>();
|
||||
_list = [];
|
||||
_freeMin = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
public MetalRenderer(Func<CAMetalLayer> metalLayer)
|
||||
{
|
||||
_device = MTLDevice.CreateSystemDefaultDevice();
|
||||
Programs = new HashSet<Program>();
|
||||
Samplers = new HashSet<SamplerHolder>();
|
||||
Programs = [];
|
||||
Samplers = [];
|
||||
|
||||
if (_device.ArgumentBuffersSupport != MTLArgumentBuffersTier.Tier2)
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
for (int setIndex = 0; setIndex < setUsages.Count; setIndex++)
|
||||
{
|
||||
List<ResourceBindingSegment> currentSegments = new();
|
||||
List<ResourceBindingSegment> currentSegments = [];
|
||||
|
||||
ResourceUsage currentUsage = default;
|
||||
int currentCount = 0;
|
||||
|
|
|
@ -20,8 +20,8 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
for (int index = 0; index < TotalSets; index++)
|
||||
{
|
||||
_resourceDescriptors[index] = new();
|
||||
_resourceUsages[index] = new();
|
||||
_resourceDescriptors[index] = [];
|
||||
_resourceUsages[index] = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
public SyncManager(MetalRenderer renderer)
|
||||
{
|
||||
_renderer = renderer;
|
||||
_handles = new List<SyncHandle>();
|
||||
_handles = [];
|
||||
}
|
||||
|
||||
public void RegisterFlush()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue