diff options
author | riperiperi <rhy3756547@hotmail.com> | 2023-09-25 22:07:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 23:07:03 +0200 |
commit | f6c3f1cdfdb9145634be3bfc54400f0d408f36dd (patch) | |
tree | aa3de1c788717cd76f5990550dad0f3ab3d397bf /src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs | |
parent | 8026e1c804fae39561087f9e04bd5c4eefa640fa (diff) |
GPU: Discard data when getting texture before full clear (#5719)1.1.1024
* GPU: Discard data when getting texture before full clear
* Fix rules and order of clear checks
* Fix formatting
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs | 19 |
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> |