diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureGroup.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureGroup.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs index ca54dc2f..cd17564a 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs @@ -435,6 +435,32 @@ namespace Ryujinx.Graphics.Gpu.Image } /// <summary> + /// Checks if a texture was modified by the GPU. + /// </summary> + /// <param name="texture">The texture to be checked</param> + /// <returns>True if any region of the texture was modified by the GPU, false otherwise</returns> + public bool AnyModified(Texture texture) + { + bool anyModified = false; + + EvaluateRelevantHandles(texture, (baseHandle, regionCount, split) => + { + for (int i = 0; i < regionCount; i++) + { + TextureGroupHandle group = _handles[baseHandle + i]; + + if (group.Modified) + { + anyModified = true; + break; + } + } + }); + + return anyModified; + } + + /// <summary> /// Flush modified ranges for a given texture. /// </summary> /// <param name="texture">The texture being used</param> |