aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
index ef7198e8..84171c7a 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
@@ -2,7 +2,6 @@
using Ryujinx.Memory.Tracking;
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Threading;
namespace Ryujinx.Graphics.Gpu.Image
@@ -156,6 +155,24 @@ namespace Ryujinx.Graphics.Gpu.Image
}
/// <summary>
+ /// Discards all data for this handle.
+ /// This clears all dirty flags, modified flags, and pending copies from other handles.
+ /// </summary>
+ public void DiscardData()
+ {
+ Modified = false;
+ DeferredCopy = null;
+
+ foreach (RegionHandle handle in Handles)
+ {
+ if (handle.Dirty)
+ {
+ handle.Reprotect();
+ }
+ }
+ }
+
+ /// <summary>
/// Calculate a list of which views overlap this handle.
/// </summary>
/// <param name="group">The parent texture group, used to find a view's base CPU VA offset</param>