aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-09-29 01:11:05 +0100
committerGitHub <noreply@github.com>2021-09-29 02:11:05 +0200
commitb6e093b0fce3dc4fe607a84f57e6406b5ab8e387 (patch)
tree442fab869bbc503f2c7e5482474fa6f25974e12d /Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs
parentfd7567a6b56fcb82a52b85097582fc0a67038457 (diff)
Force copy when auto-deleting a texture with dependencies (#2687)
When a texture is deleted by falling to the bottom of the AutoDeleteCache, its data is flushed to preserve any GPU writes that occurred. This ensures that the data appears in any textures recreated in the future, but didn't account for a texture that already existed with a copy dependency. This change forces copy dependencies to complete if a texture falls out from from the AutoDeleteCache. (not removed via overlap, as that would be wasted effort) Fixes broken lighting caused by pausing in SMO's Metro Kingdom. May fix some other issues.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs b/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs
index 726b97ea..8bc6d544 100644
--- a/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs
+++ b/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs
@@ -41,14 +41,14 @@ namespace Ryujinx.Graphics.Gpu.Image
{
Texture oldestTexture = _textures.First.Value;
- oldestTexture.SynchronizeMemory();
-
- if (oldestTexture.IsModified && !oldestTexture.CheckModified(true))
+ if (oldestTexture.IsModified && !oldestTexture.CheckModified(false))
{
// The texture must be flushed if it falls out of the auto delete cache.
// Flushes out of the auto delete cache do not trigger write tracking,
// as it is expected that other overlapping textures exist that have more up-to-date contents.
- oldestTexture.Flush(false);
+
+ oldestTexture.Group.SynchronizeDependents(oldestTexture);
+ oldestTexture.Flush(false);
}
_textures.RemoveFirst();