From 3c3bcd82fe6dfa8bdc2c9a9f33724ebfacd7dd40 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Wed, 27 Jul 2022 21:07:48 -0300
Subject: 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
---
 Ryujinx.Graphics.Gpu/Image/SamplerPool.cs | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'Ryujinx.Graphics.Gpu/Image/SamplerPool.cs')

diff --git a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
index e95800ad..eb7222f9 100644
--- a/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
+++ b/Ryujinx.Graphics.Gpu/Image/SamplerPool.cs
@@ -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>
-- 
cgit v1.2.3-70-g09d2