aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-06-02 22:40:28 -0300
committerGitHub <noreply@github.com>2024-06-02 22:40:28 -0300
commitc0f2491eaee7eb1088605f5bda8055b941a14f99 (patch)
tree4f52becd1f06d3f2dc2209be8e802f505b1d1eca /src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
parentd7c6474729ee36875cf387629afe1389655311f8 (diff)
Vulkan separate descriptor set fixes (#6895)
* Ensure descriptor sets are only re-used when all command buffers using it have completed * Fix some SPIR-V capabilities * Set update after bind flag if we exceed limits * Simpler fix for Intel * Format whitespace * Make struct readonly * Add barriers for extra set arrays too
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
index 18e28b3d..01e34c77 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs
@@ -1113,6 +1113,15 @@ namespace Ryujinx.Graphics.Gpu.Image
nextNode = nextNode.Next;
_cacheFromBuffer.Remove(toRemove.Value.Key);
_lruCache.Remove(toRemove);
+
+ if (toRemove.Value.Key.IsImage)
+ {
+ toRemove.Value.ImageArray.Dispose();
+ }
+ else
+ {
+ toRemove.Value.TextureArray.Dispose();
+ }
}
}
@@ -1124,11 +1133,20 @@ namespace Ryujinx.Graphics.Gpu.Image
{
List<CacheEntryFromPoolKey> keysToRemove = null;
- foreach (CacheEntryFromPoolKey key in _cacheFromPool.Keys)
+ foreach ((CacheEntryFromPoolKey key, CacheEntry entry) in _cacheFromPool)
{
if (key.MatchesPool(pool))
{
(keysToRemove ??= new()).Add(key);
+
+ if (key.IsImage)
+ {
+ entry.ImageArray.Dispose();
+ }
+ else
+ {
+ entry.TextureArray.Dispose();
+ }
}
}