diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/GpuContext.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/GpuContext.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/GpuContext.cs b/Ryujinx.Graphics.Gpu/GpuContext.cs index d68dd2c0..034cc065 100644 --- a/Ryujinx.Graphics.Gpu/GpuContext.cs +++ b/Ryujinx.Graphics.Gpu/GpuContext.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Gpu /// <summary> /// GPU emulation context. /// </summary> - public class GpuContext + public sealed class GpuContext : IDisposable { /// <summary> /// Host renderer. @@ -104,5 +104,18 @@ namespace Ryujinx.Graphics.Gpu { PhysicalMemory = new PhysicalMemory(cpuMemory); } + + /// <summary> + /// Disposes all GPU resources currently cached. + /// It's an error to push any GPU commands after disposal. + /// Additionally, the GPU commands FIFO must be empty for disposal, + /// and processing of all commands must have finished. + /// </summary> + public void Dispose() + { + Methods.ShaderCache.Dispose(); + Methods.BufferManager.Dispose(); + Methods.TextureManager.Dispose(); + } } }
\ No newline at end of file |
