aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2023-09-25 22:07:03 +0100
committerGitHub <noreply@github.com>2023-09-25 23:07:03 +0200
commitf6c3f1cdfdb9145634be3bfc54400f0d408f36dd (patch)
treeaa3de1c788717cd76f5990550dad0f3ab3d397bf /src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
parent8026e1c804fae39561087f9e04bd5c4eefa640fa (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/TextureGroup.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
index 1b947cd3..be33247c 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
@@ -279,6 +279,24 @@ namespace Ryujinx.Graphics.Gpu.Image
}
/// <summary>
+ /// Discards all data for a given texture.
+ /// This clears all dirty flags, modified flags, and pending copies from other textures.
+ /// </summary>
+ /// <param name="texture">The texture being discarded</param>
+ public void DiscardData(Texture texture)
+ {
+ EvaluateRelevantHandles(texture, (baseHandle, regionCount, split) =>
+ {
+ for (int i = 0; i < regionCount; i++)
+ {
+ TextureGroupHandle group = _handles[baseHandle + i];
+
+ group.DiscardData();
+ }
+ });
+ }
+
+ /// <summary>
/// Synchronize memory for a given texture.
/// If overlapping tracking handles are dirty, fully or partially synchronize the texture data.
/// </summary>