1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00

vulkan: only wait for fences on uninit if the context had a submission

This fixes a potential deadlock on exit.
This commit is contained in:
Lynne 2024-11-24 17:29:40 +01:00
parent 86e552506d
commit ce8a070cf3
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -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);