diff options
author | gdkchan <gab.dark.100@gmail.com> | 2023-01-10 22:53:56 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 01:53:56 +0000 |
commit | 94a64f2aea3225d83a2aa1e61ed8d4bf8be49e5c (patch) | |
tree | a41eb88177d15974808d4e06674113880e6e66e6 /Ryujinx.Graphics.Gpu/Image/TextureCache.cs | |
parent | 2355c2af62282ff36e56106495c09ed5cfcc3672 (diff) |
Remove textures from cache on unmap if not mapped and modified (#4211)1.1.538
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCache.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureCache.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs index 16bfc693..c020f4c8 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs @@ -1166,6 +1166,19 @@ namespace Ryujinx.Graphics.Gpu.Image } /// <summary> + /// Queues the removal of a texture from the auto delete cache. + /// </summary> + /// <remarks> + /// This function is thread safe and can be called from any thread. + /// The texture will be deleted on the next time the cache is used. + /// </remarks> + /// <param name="texture">The texture to be removed</param> + public void QueueAutoDeleteCacheRemoval(Texture texture) + { + _cache.RemoveDeferred(texture); + } + + /// <summary> /// Disposes all textures and samplers in the cache. /// It's an error to use the texture cache after disposal. /// </summary> |