GPU resource disposal

This commit is contained in:
gdkchan 2019-12-31 19:09:49 -03:00 committed by Thog
parent f7bcc884e4
commit 59fdaa744b
20 changed files with 195 additions and 46 deletions

View file

@ -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();
}
}
}