aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-11-13 18:07:05 -0300
committerGitHub <noreply@github.com>2023-11-13 18:07:05 -0300
commite6e58389164fe7cb6894dfd6e8ac1cc7d9ec7d11 (patch)
treed94d20a46102d83afff1ba1a0114aab76f8c5462 /src/Ryujinx.Graphics.Gpu/Image/Texture.cs
parent51065d91290e41a9d2518f44c9bdf83a9b0017ab (diff)
Do not set modified flag again if texture was not modified (#5909)1.1.1080
* Do not set modified flag again if texture was not modified * Formatting * Fix copy dep regression
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/Texture.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/Texture.cs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
index dca6263a..326272e7 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
@@ -102,9 +102,9 @@ namespace Ryujinx.Graphics.Gpu.Image
public bool AlwaysFlushOnOverlap { get; private set; }
/// <summary>
- /// Indicates that the texture was fully unmapped since the modified flag was set, and flushes should be ignored until it is modified again.
+ /// Indicates that the texture was modified since the last time it was flushed.
/// </summary>
- public bool FlushStale { get; private set; }
+ public bool ModifiedSinceLastFlush { get; set; }
/// <summary>
/// Increments when the host texture is swapped, or when the texture is removed from all pools.
@@ -1417,7 +1417,6 @@ namespace Ryujinx.Graphics.Gpu.Image
/// </summary>
public void SignalModified()
{
- FlushStale = false;
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
if (_modifiedStale || Group.HasCopyDependencies)
@@ -1438,14 +1437,17 @@ namespace Ryujinx.Graphics.Gpu.Image
{
if (bound)
{
- FlushStale = false;
_scaledSetScore = Math.Max(0, _scaledSetScore - 1);
}
if (_modifiedStale || Group.HasCopyDependencies || Group.HasFlushBuffer)
{
_modifiedStale = false;
- Group.SignalModifying(this, bound);
+
+ if (bound || ModifiedSinceLastFlush || Group.HasCopyDependencies || Group.HasFlushBuffer)
+ {
+ Group.SignalModifying(this, bound);
+ }
}
_physicalMemory.TextureCache.Lift(this);
@@ -1703,12 +1705,6 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <param name="unmapRange">The range of memory being unmapped</param>
public void Unmapped(MultiRange unmapRange)
{
- if (unmapRange.Contains(Range))
- {
- // If this is a full unmap, prevent flushes until the texture is mapped again.
- FlushStale = true;
- }
-
ChangedMapping = true;
if (Group.Storage == this)