Files
metal2vulkan/docs
Anees Iqbal 6898b52edf Hold freed memory for the program's own with_vk_queue submissions, and tear the device down on its own thread
On drivers that park freed memory (MoltenVK among them), memory freed while the program's own
with_vk_queue submissions may still use it now waits for them, by a mark each use signals. The watch
of those marks and the release of freed memory hold only the device parts they use, never the
device, and teardown closes the parking first and waits for the handler threads: the program's last
drop tears the device down on its own thread before it returns, as Metal's last release does
(vkDestroyDevice needs external synchronization and every child object destroyed first).
freed_memory.rs is listed among the modules that may keep the device's functions, with that reason.
Verified: the freed-memory and teardown tests on ANV, lavapipe and the M3 through MoltenVK (14 of 14
each), the two teardown tests fail without the fix, and the presenting test that crashed in the
batch passed 20 of 20 on the M3.

Folds in:
- Hold MoltenVK's freed memory for the program's own with_vk_queue submissions, by a mark each use
  signals
- Hold nothing of the device in the watch of the program's marks and the releases of freed memory
- List freed_memory.rs among the modules that keep the device's functions
2026-10-19 00:16:00 +03:00
..