From 1329c47ea46d3fa152dabe02cff82db84429545a Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 14 Nov 2023 22:24:54 -0300 Subject: [PATCH] Work around issue apparently caused by 5909 (#5926) --- src/Ryujinx.Graphics.Gpu/Image/Texture.cs | 6 +----- src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | 5 +++-- src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs | 12 ++++++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs index 326272e7ca..04c2b615fe 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs @@ -1443,11 +1443,7 @@ namespace Ryujinx.Graphics.Gpu.Image if (_modifiedStale || Group.HasCopyDependencies || Group.HasFlushBuffer) { _modifiedStale = false; - - if (bound || ModifiedSinceLastFlush || Group.HasCopyDependencies || Group.HasFlushBuffer) - { - Group.SignalModifying(this, bound); - } + Group.SignalModifying(this, bound, bound || ModifiedSinceLastFlush || Group.HasCopyDependencies || Group.HasFlushBuffer); } _physicalMemory.TextureCache.Lift(this); diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs index d7de8a3cd5..e828cb9f14 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs @@ -709,7 +709,8 @@ namespace Ryujinx.Graphics.Gpu.Image /// /// The texture that has been modified /// True if this texture is being bound, false if unbound - public void SignalModifying(Texture texture, bool bound) + /// Indicates if the modified flag should be set + public void SignalModifying(Texture texture, bool bound, bool setModified) { ModifiedSequence = _context.GetModifiedSequence(); @@ -721,7 +722,7 @@ namespace Ryujinx.Graphics.Gpu.Image { TextureGroupHandle group = _handles[baseHandle + i]; - group.SignalModifying(bound, _context); + group.SignalModifying(bound, _context, setModified); } }); } diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs index 84171c7a92..717792e04d 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs @@ -304,9 +304,17 @@ namespace Ryujinx.Graphics.Gpu.Image /// /// True if this handle is being bound, false if unbound /// The GPU context to register a sync action on - public void SignalModifying(bool bound, GpuContext context) + /// Indicates if the modified flag should be set + public void SignalModifying(bool bound, GpuContext context, bool setModified) { - SignalModified(context); + if (setModified) + { + SignalModified(context); + } + else + { + RegisterSync(context); + } if (!bound && _syncActionRegistered && NextSyncCopies()) {