vulkan/malloc: switch to wall clock garbage collection
Instead of counting the number of vk_malloc_garbage_collect
calls,
which can vary wildly (e.g. being incremented on every pl_gpu_flush
),
use a real wall clock estimate.
The default expiry time of 100 ms is probably fine, it leaves plenty of headroom for typical video playback (which should surely exceed 10 fps!).
Merge request reports
Activity
So, I'm not very happy with this approach either, for a multitude of reasons. Not only is 100ms too short in practice (longer than time to seek, usually), but increasing limit would also be bad: consider use in offline encoding scenario where we can hit thousands of fps, if e.g. frame size changes with every frame then we can persist hundreds or thousands of stale allocations.
I think it's best to stick with a number-of-GC-calls derived age for this reason. But maybe we can do something smarter to avoid double-incrementing age when just calling pl_gpu_flush() right before submit_frame()?