diff options
author | riperiperi <rhy3756547@hotmail.com> | 2021-09-29 01:11:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 02:11:05 +0200 |
commit | b6e093b0fce3dc4fe607a84f57e6406b5ab8e387 (patch) | |
tree | 442fab869bbc503f2c7e5482474fa6f25974e12d /Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | |
parent | fd7567a6b56fcb82a52b85097582fc0a67038457 (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/TextureGroup.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs index 1fe0bbf7..2bd97432 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs @@ -235,6 +235,23 @@ namespace Ryujinx.Graphics.Gpu.Image } /// <summary> + /// Synchronize dependent textures, if any of them have deferred a copy from the given texture. + /// </summary> + /// <param name="texture">The texture to synchronize dependents of</param> + public void SynchronizeDependents(Texture texture) + { + EvaluateRelevantHandles(texture, (baseHandle, regionCount, split) => + { + for (int i = 0; i < regionCount; i++) + { + TextureGroupHandle group = _handles[baseHandle + i]; + + group.SynchronizeDependents(); + } + }); + } + + /// <summary> /// Signal that a texture in the group has been modified by the GPU. /// </summary> /// <param name="texture">The texture that has been modified</param> |