mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-29 11:56:24 +02:00
GPU: Discard data when getting texture before full clear (#5719)
* GPU: Discard data when getting texture before full clear * Fix rules and order of clear checks * Fix formatting
This commit is contained in:
parent
8026e1c804
commit
f6c3f1cdfd
10 changed files with 205 additions and 11 deletions
|
@ -278,6 +278,24 @@ namespace Ryujinx.Graphics.Gpu.Image
|
|||
return dirty;
|
||||
}
|
||||
|
||||
/// <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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue