diff options
author | Lynne <dev@lynne.ee> | 2024-11-24 17:29:40 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-11-26 14:14:14 +0100 |
commit | ce8a070cf39dd46e43cc91165740dad4acddcfdd (patch) | |
tree | fd90aef8e7c6b9669b8c397f6e395e18a3eeaf8d | |
parent | 86e552506dbeee9b43f209d441cfee1e81eb1287 (diff) | |
download | ffmpeg-ce8a070cf39dd46e43cc91165740dad4acddcfdd.tar.gz |
vulkan: only wait for fences on uninit if the context had a submission
This fixes a potential deadlock on exit.
-rw-r--r-- | libavutil/vulkan.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index eaf73eb4fd..904d3a9a55 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -247,7 +247,8 @@ void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool) FFVkExecContext *e = &pool->contexts[i]; if (e->fence) { - vk->WaitForFences(s->hwctx->act_dev, 1, &e->fence, VK_TRUE, UINT64_MAX); + if (e->had_submission) + vk->WaitForFences(s->hwctx->act_dev, 1, &e->fence, VK_TRUE, UINT64_MAX); vk->DestroyFence(s->hwctx->act_dev, e->fence, s->hwctx->alloc); } pthread_mutex_destroy(&e->lock); |