aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs b/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs
index 9ab7e292..6c249ca6 100644
--- a/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs
@@ -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)