diff options
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/TextureCopy.cs')
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/TextureCopy.cs | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/Ryujinx.Graphics.OpenGL/TextureCopy.cs b/Ryujinx.Graphics.OpenGL/TextureCopy.cs index 75ef07c1..244ace8a 100644 --- a/Ryujinx.Graphics.OpenGL/TextureCopy.cs +++ b/Ryujinx.Graphics.OpenGL/TextureCopy.cs @@ -1,9 +1,10 @@ using Ryujinx.Graphics.GAL; using OpenTK.Graphics.OpenGL; +using System; namespace Ryujinx.Graphics.OpenGL { - class TextureCopy + class TextureCopy : IDisposable { private int _srcFramebuffer; private int _dstFramebuffer; @@ -53,11 +54,6 @@ namespace Ryujinx.Graphics.OpenGL GL.Enable(EnableCap.FramebufferSrgb); } - private static void Detach(FramebufferTarget target, Format format) - { - Attach(target, format, 0); - } - private static void Attach(FramebufferTarget target, Format format, int handle) { if (format == Format.D24UnormS8Uint || format == Format.D32FloatS8Uint) @@ -124,5 +120,22 @@ namespace Ryujinx.Graphics.OpenGL return _dstFramebuffer; } + + public void Dispose() + { + if (_srcFramebuffer != 0) + { + GL.DeleteFramebuffer(_srcFramebuffer); + + _srcFramebuffer = 0; + } + + if (_dstFramebuffer != 0) + { + GL.DeleteFramebuffer(_dstFramebuffer); + + _dstFramebuffer = 0; + } + } } } |
