misc: chore: Fix object creation in Gpu project

This commit is contained in:
Evan Husted 2025-01-26 15:18:04 -06:00
parent 4e47c86f90
commit 929a16dd26
18 changed files with 231 additions and 231 deletions

View file

@ -277,7 +277,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <param name="descriptor">Last used texture descriptor</param>
public void AddShortCache(Texture texture, ref TextureDescriptor descriptor)
{
ShortTextureCacheEntry entry = new ShortTextureCacheEntry(descriptor, texture);
ShortTextureCacheEntry entry = new(descriptor, texture);
_shortCacheBuilder.Add(entry);
_shortCacheLookup.Add(entry.Descriptor, entry);
@ -296,7 +296,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{
if (texture.ShortCacheEntry != null)
{
ShortTextureCacheEntry entry = new ShortTextureCacheEntry(texture);
ShortTextureCacheEntry entry = new(texture);
_shortCacheBuilder.Add(entry);

View file

@ -992,7 +992,7 @@ namespace Ryujinx.Graphics.Gpu.Image
bool isImage,
out bool isNew)
{
CacheEntryFromPoolKey key = new CacheEntryFromPoolKey(isImage, bindingInfo, texturePool, samplerPool);
CacheEntryFromPoolKey key = new(isImage, bindingInfo, texturePool, samplerPool);
isNew = !_cacheFromPool.TryGetValue(key, out CacheEntry entry);
@ -1035,7 +1035,7 @@ namespace Ryujinx.Graphics.Gpu.Image
ref BufferBounds textureBufferBounds,
out bool isNew)
{
CacheEntryFromBufferKey key = new CacheEntryFromBufferKey(
CacheEntryFromBufferKey key = new(
isImage,
bindingInfo,
texturePool,

View file

@ -947,7 +947,7 @@ namespace Ryujinx.Graphics.Gpu.Image
bool hasLayerViews = false;
bool hasMipViews = false;
List<TextureIncompatibleOverlap> incompatibleOverlaps = new List<TextureIncompatibleOverlap>();
List<TextureIncompatibleOverlap> incompatibleOverlaps = new();
for (int index = 0; index < overlapsCount; index++)
{

View file

@ -1019,7 +1019,7 @@ namespace Ryujinx.Graphics.Gpu.Image
int endOffset = _allOffsets[viewEnd] + _sliceSizes[lastLevel];
int size = endOffset - offset;
List<RegionHandle> result = new List<RegionHandle>();
List<RegionHandle> result = new();
for (int i = 0; i < TextureRange.Count; i++)
{
@ -1053,7 +1053,7 @@ namespace Ryujinx.Graphics.Gpu.Image
offset = _allOffsets[viewStart];
ulong maxSize = Storage.Size - (ulong)offset;
TextureGroupHandle groupHandle = new TextureGroupHandle(
TextureGroupHandle groupHandle = new(
this,
offset,
Math.Min(maxSize, (ulong)size),
@ -1337,7 +1337,7 @@ namespace Ryujinx.Graphics.Gpu.Image
Array.Resize(ref cpuRegionHandles, count);
}
TextureGroupHandle groupHandle = new TextureGroupHandle(this, 0, Storage.Size, _views, 0, 0, 0, _allOffsets.Length, cpuRegionHandles);
TextureGroupHandle groupHandle = new(this, 0, Storage.Size, _views, 0, 0, 0, _allOffsets.Length, cpuRegionHandles);
handles = new TextureGroupHandle[] { groupHandle };
}
@ -1355,7 +1355,7 @@ namespace Ryujinx.Graphics.Gpu.Image
if (_is3D)
{
List<TextureGroupHandle> handlesList = new List<TextureGroupHandle>();
List<TextureGroupHandle> handlesList = new();
for (int i = 0; i < levelHandles; i++)
{
@ -1438,8 +1438,8 @@ namespace Ryujinx.Graphics.Gpu.Image
// Get the location of each texture within its storage, so we can find the handles to apply the dependency to.
// This can consist of multiple disjoint regions, for example if this is a mip slice of an array texture.
List<(int BaseHandle, int RegionCount)> targetRange = new List<(int BaseHandle, int RegionCount)>();
List<(int BaseHandle, int RegionCount)> otherRange = new List<(int BaseHandle, int RegionCount)>();
List<(int BaseHandle, int RegionCount)> targetRange = new();
List<(int BaseHandle, int RegionCount)> otherRange = new();
EvaluateRelevantHandles(firstLayer, firstLevel, other.Info.GetSlices(), other.Info.Levels, (baseHandle, regionCount, split) => targetRange.Add((baseHandle, regionCount)));
otherGroup.EvaluateRelevantHandles(other, (baseHandle, regionCount, split) => otherRange.Add((baseHandle, regionCount)));