diff options
author | Mary <me@thog.eu> | 2021-06-09 01:00:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-09 01:00:28 +0200 |
commit | afd68d4c6cb0e08a02cbd29f45083a4b620f1f4c (patch) | |
tree | 16ac5b6288c73be69f291cc70dd2b6f60d76371b /Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs | |
parent | 60cf3dfebc6bc573fb90a1b9645bca43da3d65f6 (diff) |
GAL: Fix sampler leaks on exit (#2353)
Before this, all samplers instance were leaking on exit because the
dispose method was never getting called.
This fix this issue by making TextureBindingsManager disposable and
calling the dispose method in the TextureManager.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs index 79effedf..1989131e 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs @@ -1,13 +1,14 @@ using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Gpu.State; using Ryujinx.Graphics.Shader; +using System; namespace Ryujinx.Graphics.Gpu.Image { /// <summary> /// Texture bindings manager. /// </summary> - class TextureBindingsManager + class TextureBindingsManager : IDisposable { private const int HandleHigh = 16; private const int HandleMask = (1 << HandleHigh) - 1; @@ -505,5 +506,13 @@ namespace Ryujinx.Graphics.Gpu.Image { _rebind = true; } + + /// <summary> + /// Disposes all textures and samplers in the cache. + /// </summary> + public void Dispose() + { + _samplerPool?.Dispose(); + } } }
\ No newline at end of file |