diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2023-05-31 22:43:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-31 21:43:20 +0000 |
| commit | c6676007bfdc65724afebac27990c47a5d6aa3dd (patch) | |
| tree | 83196584e20c31b405db2f801a01c0204bc588bf /src/Ryujinx.Graphics.Gpu/GpuContext.cs | |
| parent | 92b0b7d753a07b9865386881524838fe42f3668a (diff) | |
GPU: Dispose Renderer after running deferred actions (#5144)
* GAL: Dispose Renderer after running deferred actions
Deferred actions from disposing physical memory instances always dispose the resources in their caches. The renderer can't be disposed before these resources get disposed, otherwise the dispose actions will not actually run, and the ThreadedRenderer may get stuck trying to enqueue too many commands when there is nothing consuming them.
This should fix most instances of the emulator freezing on close.
* Wait for main render commands to finish, but keep RenderThread alive til dispose
* Address some feedback.
* No parameterize needed
* Set thread name as part of constructor
* Port to Ava and SDL2
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/GpuContext.cs')
| -rw-r--r-- | src/Ryujinx.Graphics.Gpu/GpuContext.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/GpuContext.cs b/src/Ryujinx.Graphics.Gpu/GpuContext.cs index 0fe6a28f..233227b4 100644 --- a/src/Ryujinx.Graphics.Gpu/GpuContext.cs +++ b/src/Ryujinx.Graphics.Gpu/GpuContext.cs @@ -390,7 +390,6 @@ namespace Ryujinx.Graphics.Gpu /// </summary> public void Dispose() { - Renderer.Dispose(); GPFifo.Dispose(); HostInitalized.Dispose(); @@ -403,6 +402,8 @@ namespace Ryujinx.Graphics.Gpu PhysicalMemoryRegistry.Clear(); RunDeferredActions(); + + Renderer.Dispose(); } } }
\ No newline at end of file |
