diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureCache.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureCache.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs index c020f4c8..49adecdc 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureCache.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureCache.cs @@ -895,6 +895,16 @@ namespace Ryujinx.Graphics.Gpu.Image } /// <summary> + /// Attempt to find a texture on the short duration cache. + /// </summary> + /// <param name="descriptor">The texture descriptor</param> + /// <returns>The texture if found, null otherwise</returns> + public Texture FindShortCache(in TextureDescriptor descriptor) + { + return _cache.FindShortCache(descriptor); + } + + /// <summary> /// Tries to find an existing texture matching the given buffer copy destination. If none is found, returns null. /// </summary> /// <param name="memoryManager">GPU memory manager where the texture is mapped</param> @@ -1179,6 +1189,33 @@ namespace Ryujinx.Graphics.Gpu.Image } /// <summary> + /// Adds a texture to the short duration cache. This typically keeps it alive for two ticks. + /// </summary> + /// <param name="texture">Texture to add to the short cache</param> + /// <param name="descriptor">Last used texture descriptor</param> + public void AddShortCache(Texture texture, ref TextureDescriptor descriptor) + { + _cache.AddShortCache(texture, ref descriptor); + } + + /// <summary> + /// Removes a texture from the short duration cache. + /// </summary> + /// <param name="texture">Texture to remove from the short cache</param> + public void RemoveShortCache(Texture texture) + { + _cache.RemoveShortCache(texture); + } + + /// <summary> + /// Ticks periodic elements of the texture cache. + /// </summary> + public void Tick() + { + _cache.ProcessShortCache(); + } + + /// <summary> /// Disposes all textures and samplers in the cache. /// It's an error to use the texture cache after disposal. /// </summary> |