change(Core): deinit platform after GPU backend release
This commit is contained in:
parent
59b453c024
commit
355dd53857
1 changed files with 9 additions and 1 deletions
10
src/Core.zig
10
src/Core.zig
|
|
@ -355,13 +355,21 @@ pub fn deinit(entities: *mach.Entities.Mod, core: *Mod) !void {
|
|||
}
|
||||
}
|
||||
|
||||
state.platform.deinit();
|
||||
// GPU backend (ie. d3d12, metal, opengl, vulkan)
|
||||
//
|
||||
// Must be done BEFORE platform deinit.
|
||||
// Otherwise, we enter a race condition where GPU might try to present
|
||||
// to the window server.
|
||||
state.swap_chain.release();
|
||||
state.queue.release();
|
||||
state.device.release();
|
||||
state.surface.release();
|
||||
state.adapter.release();
|
||||
state.instance.release();
|
||||
|
||||
// Platform (ie. Windows, MacOS, Linux X11 or Wayland)
|
||||
state.platform.deinit();
|
||||
|
||||
state.events.deinit();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue