Add XML documentation to Ryujinx.Graphics.Gpu.Image

This commit is contained in:
gdkchan 2019-12-29 20:26:37 -03:00 committed by Thog
parent 53bbc1311f
commit 32764f9560
24 changed files with 1133 additions and 61 deletions

View file

@ -2,6 +2,11 @@ using System.Collections.Generic;
namespace Ryujinx.Graphics.Gpu.Image
{
/// <summary>
/// Texture pool cache.
/// This can keep multiple texture pools, and return the current one as needed.
/// It is useful for applications that uses multiple texture pools.
/// </summary>
class TexturePoolCache
{
private const int MaxCapacity = 4;
@ -10,6 +15,10 @@ namespace Ryujinx.Graphics.Gpu.Image
private LinkedList<TexturePool> _pools;
/// <summary>
/// Constructs a new instance of the texture pool.
/// </summary>
/// <param name="context"></param>
public TexturePoolCache(GpuContext context)
{
_context = context;
@ -17,6 +26,12 @@ namespace Ryujinx.Graphics.Gpu.Image
_pools = new LinkedList<TexturePool>();
}
/// <summary>
/// Finds a cache texture pool, or creates a new one if not found.
/// </summary>
/// <param name="address">Start address of the texture pool</param>
/// <param name="maximumId">Maximum ID of the texture pool</param>
/// <returns>The found or newly created texture pool</returns>
public TexturePool FindOrCreate(ulong address, int maximumId)
{
TexturePool pool;
@ -58,6 +73,11 @@ namespace Ryujinx.Graphics.Gpu.Image
return pool;
}
/// <summary>
/// Invalidates a memory range of all intersecting texture pools on the cache.
/// </summary>
/// <param name="address">Start address of the range to invalidate</param>
/// <param name="size">Size of the range to invalidate</param>
public void InvalidateRange(ulong address, ulong size)
{
for (LinkedListNode<TexturePool> node = _pools.First; node != null; node = node.Next)