From 94a64f2aea3225d83a2aa1e61ed8d4bf8be49e5c Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 10 Jan 2023 22:53:56 -0300 Subject: Remove textures from cache on unmap if not mapped and modified (#4211) --- Ryujinx.Graphics.Gpu/Image/TextureCache.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCache.cs') 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 @@ -1165,6 +1165,19 @@ namespace Ryujinx.Graphics.Gpu.Image } } + /// + /// Queues the removal of a texture from the auto delete cache. + /// + /// + /// 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. + /// + /// The texture to be removed + public void QueueAutoDeleteCacheRemoval(Texture texture) + { + _cache.RemoveDeferred(texture); + } + /// /// Disposes all textures and samplers in the cache. /// It's an error to use the texture cache after disposal. -- cgit v1.2.3