mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-05 16:18:54 +02:00
misc: chore: Use collection expressions (part 2)
This commit is contained in:
@@ -118,10 +118,10 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// </summary>
|
||||
public AutoDeleteCache()
|
||||
{
|
||||
_textures = new LinkedList<Texture>();
|
||||
_textures = [];
|
||||
|
||||
_shortCacheBuilder = new HashSet<ShortTextureCacheEntry>();
|
||||
_shortCache = new HashSet<ShortTextureCacheEntry>();
|
||||
_shortCacheBuilder = [];
|
||||
_shortCache = [];
|
||||
|
||||
_shortCacheLookup = new Dictionary<TextureDescriptor, ShortTextureCacheEntry>();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
public PoolCache(GpuContext context)
|
||||
{
|
||||
_context = context;
|
||||
_pools = new LinkedList<T>();
|
||||
_pools = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -260,8 +260,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
_viewStorage = this;
|
||||
|
||||
_views = new List<Texture>();
|
||||
_poolOwners = new List<TexturePoolOwner>();
|
||||
_views = [];
|
||||
_poolOwners = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -549,7 +549,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
_channel = channel;
|
||||
_cacheFromBuffer = new Dictionary<CacheEntryFromBufferKey, CacheEntryFromBuffer>();
|
||||
_cacheFromPool = new Dictionary<CacheEntryFromPoolKey, CacheEntry>();
|
||||
_lruCache = new LinkedList<CacheEntryFromBuffer>();
|
||||
_lruCache = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1116,7 +1116,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
if (key.MatchesPool(pool))
|
||||
{
|
||||
(keysToRemove ??= new()).Add(key);
|
||||
(keysToRemove ??= []).Add(key);
|
||||
|
||||
if (key.IsImage)
|
||||
{
|
||||
|
||||
@@ -58,15 +58,15 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
_context = context;
|
||||
_physicalMemory = physicalMemory;
|
||||
|
||||
_textures = new MultiRangeList<Texture>();
|
||||
_partiallyMappedTextures = new HashSet<Texture>();
|
||||
_textures = [];
|
||||
_partiallyMappedTextures = [];
|
||||
|
||||
_texturesLock = new ReaderWriterLockSlim();
|
||||
|
||||
_textureOverlaps = new Texture[OverlapsBufferInitialCapacity];
|
||||
_overlapInfo = new OverlapInfo[OverlapsBufferInitialCapacity];
|
||||
|
||||
_cache = new AutoDeleteCache();
|
||||
_cache = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -892,7 +892,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
// otherwise we only need the data that is copied from the existing texture, without loading the CPU data.
|
||||
bool updateNewTexture = texture.Width > overlap.Width || texture.Height > overlap.Height;
|
||||
|
||||
texture.InitializeGroup(true, true, new List<TextureIncompatibleOverlap>());
|
||||
texture.InitializeGroup(true, true, []);
|
||||
texture.InitializeData(false, updateNewTexture);
|
||||
|
||||
overlap.SynchronizeMemory();
|
||||
|
||||
@@ -134,8 +134,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
Offset = offset;
|
||||
Size = (int)size;
|
||||
Overlaps = new List<Texture>();
|
||||
Dependencies = new List<TextureDependency>();
|
||||
Overlaps = [];
|
||||
Dependencies = [];
|
||||
|
||||
BaseSlice = baseSlice;
|
||||
SliceCount = sliceCount;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
/// </summary>
|
||||
public TextureAliasList()
|
||||
{
|
||||
_aliases = new List<Alias>();
|
||||
_aliases = [];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user