Remove textures from cache on unmap if not mapped and modified (#4211)
This commit is contained in:
parent
2355c2af62
commit
94a64f2aea
4 changed files with 72 additions and 0 deletions
|
@ -434,6 +434,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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue