misc: chore: Use collection expressions (part 2)

This commit is contained in:
KeatonTheBot
2025-03-10 21:32:01 -05:00
parent c923c0043a
commit 340ec79e9f
176 changed files with 308 additions and 308 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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);
}
+3 -3
View File
@@ -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>();
}
+1 -1
View File
@@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Vulkan
public IdList()
{
_list = new List<T>();
_list = [];
_freeMin = 0;
}
+1 -1
View File
@@ -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);
}
+4 -4
View File
@@ -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] = [];
}
}
+1 -1
View File
@@ -33,7 +33,7 @@ namespace Ryujinx.Graphics.Vulkan
{
_gd = gd;
_device = device;
_handles = new List<SyncHandle>();
_handles = [];
}
public void RegisterFlush()
+1 -1
View File
@@ -113,7 +113,7 @@ namespace Ryujinx.Graphics.Vulkan
if (storages == null)
{
storages = new HashSet<TextureStorage>();
storages = [];
for (int index = 0; index < _textureRefs.Length; index++)
{