aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Image/Texture.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/Texture.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/Texture.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/Texture.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
index 0fce4deb..022a3839 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs
@@ -571,6 +571,18 @@ namespace Ryujinx.Graphics.Gpu.Image
}
/// <summary>
+ /// Discards all data for this texture.
+ /// This clears all dirty flags, modified flags, and pending copies from other textures.
+ /// It should be used if the texture data will be fully overwritten by the next use.
+ /// </summary>
+ public void DiscardData()
+ {
+ Group.DiscardData(this);
+
+ _dirty = false;
+ }
+
+ /// <summary>
/// Synchronizes guest and host memory.
/// This will overwrite the texture data with the texture data on the guest memory, if a CPU
/// modification is detected.