aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/Texture.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-01-10 22:53:56 -0300
committerGitHub <noreply@github.com>2023-01-11 01:53:56 +0000
commit94a64f2aea3225d83a2aa1e61ed8d4bf8be49e5c (patch)
treea41eb88177d15974808d4e06674113880e6e66e6 /Ryujinx.Graphics.Gpu/Image/Texture.cs
parent2355c2af62282ff36e56106495c09ed5cfcc3672 (diff)
Remove textures from cache on unmap if not mapped and modified (#4211)1.1.538
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/Texture.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs
index 0995314d..f0c31be6 100644
--- a/Ryujinx.Graphics.Gpu/Image/Texture.cs
+++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs
@@ -1676,6 +1676,13 @@ namespace Ryujinx.Graphics.Gpu.Image
}
RemoveFromPools(true);
+
+ // We only want to remove if there's no mapped region of the texture that was modified by the GPU,
+ // otherwise we could lose data.
+ if (!Group.AnyModified(this))
+ {
+ _physicalMemory.TextureCache.QueueAutoDeleteCacheRemoval(this);
+ }
}
/// <summary>