aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/SamplerPool.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/SamplerPool.cs35
1 files changed, 35 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
index e205ec48..e95800ad 100644
--- a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
+++ b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
@@ -48,6 +48,8 @@ namespace Ryujinx.Graphics.Gpu.Image
Items[i] = null;
}
}
+
+ UpdateModifiedSequence();
}
SequenceNumber = Context.SequenceNumber;
@@ -72,6 +74,39 @@ namespace Ryujinx.Graphics.Gpu.Image
}
/// <summary>
+ /// Checks if the pool was modified, and returns the last sequence number where a modification was detected.
+ /// </summary>
+ /// <returns>A number that increments each time a modification is detected</returns>
+ public int CheckModified()
+ {
+ if (SequenceNumber != Context.SequenceNumber)
+ {
+ SequenceNumber = Context.SequenceNumber;
+
+ if (_forcedAnisotropy != GraphicsConfig.MaxAnisotropy)
+ {
+ _forcedAnisotropy = GraphicsConfig.MaxAnisotropy;
+
+ for (int i = 0; i < Items.Length; i++)
+ {
+ if (Items[i] != null)
+ {
+ Items[i].Dispose();
+
+ Items[i] = null;
+ }
+ }
+
+ UpdateModifiedSequence();
+ }
+
+ SynchronizeMemory();
+ }
+
+ return ModifiedSequenceNumber;
+ }
+
+ /// <summary>
/// Implementation of the sampler pool range invalidation.
/// </summary>
/// <param name="address">Start address of the range of the sampler pool</param>