diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs b/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs index c9eebf8b..99c5a88b 100644 --- a/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs +++ b/Ryujinx.Graphics.Gpu/Image/TexturePoolCache.cs @@ -8,13 +8,12 @@ namespace Ryujinx.Graphics.Gpu.Image /// 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 : IDisposable + class TexturePoolCache { private const int MaxCapacity = 4; - private GpuContext _context; - - private LinkedList<TexturePool> _pools; + private readonly GpuContext _context; + private readonly LinkedList<TexturePool> _pools; /// <summary> /// Constructs a new instance of the texture pool. @@ -23,17 +22,17 @@ namespace Ryujinx.Graphics.Gpu.Image public TexturePoolCache(GpuContext context) { _context = context; - _pools = new LinkedList<TexturePool>(); } /// <summary> /// Finds a cache texture pool, or creates a new one if not found. /// </summary> + /// <param name="channel">GPU channel that the texture pool cache belongs to</param> /// <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) + public TexturePool FindOrCreate(GpuChannel channel, ulong address, int maximumId) { TexturePool pool; @@ -56,7 +55,7 @@ namespace Ryujinx.Graphics.Gpu.Image } // If not found, create a new one. - pool = new TexturePool(_context, address, maximumId); + pool = new TexturePool(_context, channel, address, maximumId); pool.CacheNode = _pools.AddLast(pool); @@ -73,19 +72,5 @@ namespace Ryujinx.Graphics.Gpu.Image return pool; } - - /// <summary> - /// Disposes the texture pool cache. - /// It's an error to use the texture pool cache after disposal. - /// </summary> - public void Dispose() - { - foreach (TexturePool pool in _pools) - { - pool.Dispose(); - } - - _pools.Clear(); - } } }
\ No newline at end of file |