mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-25 05:00:08 +02:00
misc: chore: Use collection expressions (part 2)
This commit is contained in:
@@ -19,9 +19,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
private readonly NativeArray<BufferMemoryBarrier> _bufferBarrierBatch = new(MaxBarriersPerCall);
|
||||
private readonly NativeArray<ImageMemoryBarrier> _imageBarrierBatch = new(MaxBarriersPerCall);
|
||||
|
||||
private readonly List<BarrierWithStageFlags<MemoryBarrier, int>> _memoryBarriers = new();
|
||||
private readonly List<BarrierWithStageFlags<BufferMemoryBarrier, int>> _bufferBarriers = new();
|
||||
private readonly List<BarrierWithStageFlags<ImageMemoryBarrier, TextureStorage>> _imageBarriers = new();
|
||||
private readonly List<BarrierWithStageFlags<MemoryBarrier, int>> _memoryBarriers = [];
|
||||
private readonly List<BarrierWithStageFlags<BufferMemoryBarrier, int>> _bufferBarriers = [];
|
||||
private readonly List<BarrierWithStageFlags<ImageMemoryBarrier, TextureStorage>> _imageBarriers = [];
|
||||
private int _queuedBarrierCount;
|
||||
|
||||
private enum IncoherentBarrierType
|
||||
|
||||
@@ -486,7 +486,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
(int keyOffset, int keySize) = FromMirrorKey(key);
|
||||
if (!(offset + size <= keyOffset || offset >= keyOffset + keySize))
|
||||
{
|
||||
toRemove ??= new List<ulong>();
|
||||
toRemove ??= [];
|
||||
|
||||
toRemove.Add(key);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
if (entry.DependencyList == null)
|
||||
{
|
||||
entry.DependencyList = new List<Dependency>();
|
||||
entry.DependencyList = [];
|
||||
entries[i] = entry;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
DestroyEntry(entry);
|
||||
}
|
||||
|
||||
(toRemove ??= new List<ulong>()).Add(range.Key);
|
||||
(toRemove ??= []).Add(range.Key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
if (!_ranges.TryGetValue(key, out List<Entry> value))
|
||||
{
|
||||
value = new List<Entry>();
|
||||
value = [];
|
||||
_ranges.Add(key, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
api.AllocateCommandBuffers(device, in allocateInfo, out CommandBuffer);
|
||||
|
||||
Dependants = new List<IAuto>();
|
||||
Waitables = new List<MultiFenceHolder>();
|
||||
Dependants = [];
|
||||
Waitables = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
_hostMemoryApi = hostMemoryApi;
|
||||
_device = device;
|
||||
|
||||
_allocations = new List<HostMemoryAllocation>();
|
||||
_allocations = [];
|
||||
_allocationTree = new IntervalTree<ulong, HostMemoryAllocation>();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
public IdList()
|
||||
{
|
||||
_list = new List<T>();
|
||||
_list = [];
|
||||
_freeMin = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
if (storages == null)
|
||||
{
|
||||
storages = new HashSet<TextureStorage>();
|
||||
storages = [];
|
||||
|
||||
for (int index = 0; index < _textureRefs.Length; index++)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
_api = api;
|
||||
_physicalDevice = physicalDevice;
|
||||
_device = device;
|
||||
_blockLists = new List<MemoryAllocatorBlockList>();
|
||||
_blockLists = [];
|
||||
_blockAlignment = (int)Math.Min(int.MaxValue, MaxDeviceMemoryUsageEstimate / _physicalDevice.PhysicalDeviceProperties.Limits.MaxMemoryAllocationCount);
|
||||
_lock = new(LockRecursionPolicy.NoRecursion);
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
public PipelineFull(VulkanRenderer gd, Device device) : base(gd, device)
|
||||
{
|
||||
_activeQueries = new List<(QueryPool, bool)>();
|
||||
_pendingQueryCopies = new();
|
||||
_backingSwaps = new();
|
||||
_activeBufferMirrors = new();
|
||||
_activeQueries = [];
|
||||
_pendingQueryCopies = [];
|
||||
_backingSwaps = [];
|
||||
_activeBufferMirrors = [];
|
||||
|
||||
CommandBuffer = (Cbs = gd.CommandBufferPool.Rent()).CommandBuffer;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
for (int j = 0; j < _dsCache[i].Length; j++)
|
||||
{
|
||||
_dsCache[i][j] = new List<Auto<DescriptorSetCollection>>();
|
||||
_dsCache[i][j] = [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
FreeCompletedManualDescriptorSets();
|
||||
|
||||
var list = _manualDsCache[setIndex] ??= new();
|
||||
var list = _manualDsCache[setIndex] ??= [];
|
||||
var span = CollectionsMarshal.AsSpan(list);
|
||||
|
||||
Queue<int> freeQueue = _freeManualDsCacheEntries[setIndex];
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
_textures = textures;
|
||||
_key = key;
|
||||
|
||||
_forcedFences = new List<ForcedFence>();
|
||||
_forcedFences = [];
|
||||
}
|
||||
|
||||
public Auto<DisposableFramebuffer> GetFramebuffer(VulkanRenderer gd, CommandBufferScoped cbs, FramebufferParams fb)
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
for (int index = 0; index < TotalSets; index++)
|
||||
{
|
||||
_resourceDescriptors[index] = new();
|
||||
_resourceUsages[index] = new();
|
||||
_resourceDescriptors[index] = [];
|
||||
_resourceUsages[index] = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
{
|
||||
_gd = gd;
|
||||
_device = device;
|
||||
_handles = new List<SyncHandle>();
|
||||
_handles = [];
|
||||
}
|
||||
|
||||
public void RegisterFlush()
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
if (storages == null)
|
||||
{
|
||||
storages = new HashSet<TextureStorage>();
|
||||
storages = [];
|
||||
|
||||
for (int index = 0; index < _textureRefs.Length; index++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user