Add a sampler pool cache and improve texture pool cache (#3487)

* Add a sampler pool cache and improve texture pool cache

* Increase disposal timestamp delta more to be on the safe side

* Nits

* Use abstract class for PoolCache, remove factory callback
This commit is contained in:
gdkchan 2022-07-27 21:07:48 -03:00 committed by GitHub
parent a00c59a46c
commit 3c3bcd82fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 321 additions and 136 deletions

View file

@ -1,16 +1,27 @@
using Ryujinx.Graphics.Gpu.Memory;
using System.Collections.Generic;
namespace Ryujinx.Graphics.Gpu.Image
{
/// <summary>
/// Sampler pool.
/// </summary>
class SamplerPool : Pool<Sampler, SamplerDescriptor>
class SamplerPool : Pool<Sampler, SamplerDescriptor>, IPool<SamplerPool>
{
private float _forcedAnisotropy;
/// <summary>
/// Constructs a new instance of the sampler pool.
/// Linked list node used on the sampler pool cache.
/// </summary>
public LinkedListNode<SamplerPool> CacheNode { get; set; }
/// <summary>
/// Timestamp used by the sampler pool cache, updated on every use of this sampler pool.
/// </summary>
public ulong CacheTimestamp { get; set; }
/// <summary>
/// Creates a new instance of the sampler pool.
/// </summary>
/// <param name="context">GPU context that the sampler pool belongs to</param>
/// <param name="physicalMemory">Physical memory where the sampler descriptors are mapped</param>