mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-04 20:35:46 +00:00
Avoid lookup of invalid textures if pool did not change (ryubing/ryujinx!113)
See merge request ryubing/ryujinx!113
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Ryujinx.Common.Collections;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Gpu.Memory;
|
||||
@@ -72,6 +73,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
}
|
||||
|
||||
private readonly GpuChannel _channel;
|
||||
private readonly BitMap _invalidMap;
|
||||
private readonly ConcurrentQueue<DereferenceRequest> _dereferenceQueue = new();
|
||||
private TextureDescriptor _defaultDescriptor;
|
||||
|
||||
@@ -166,6 +168,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
{
|
||||
_channel = channel;
|
||||
_aliasLists = new Dictionary<Texture, TextureAliasList>();
|
||||
_invalidMap = new BitMap(maximumId + 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -182,6 +185,11 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
|
||||
if (texture == null)
|
||||
{
|
||||
if (_invalidMap.IsSet(id))
|
||||
{
|
||||
return ref descriptor;
|
||||
}
|
||||
|
||||
texture = PhysicalMemory.TextureCache.FindShortCache(descriptor);
|
||||
|
||||
if (texture == null)
|
||||
@@ -198,6 +206,7 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
// If this happens, then the texture address is invalid, we can't add it to the cache.
|
||||
if (texture == null)
|
||||
{
|
||||
_invalidMap.Set(id);
|
||||
return ref descriptor;
|
||||
}
|
||||
}
|
||||
@@ -515,6 +524,8 @@ namespace Ryujinx.Graphics.Gpu.Image
|
||||
RemoveAliasList(texture);
|
||||
}
|
||||
}
|
||||
|
||||
_invalidMap.Clear(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user