diff options
author | Lynne <dev@lynne.ee> | 2021-11-07 08:44:46 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2021-11-12 05:23:39 +0100 |
commit | bde1fc5386282142697dbaf91fe57744ba63fec1 (patch) | |
tree | 181acd3ca871125b3fcf9f9c47c59ba0eefcd7e1 /libavutil/hwcontext_vulkan.c | |
parent | f7f16136388b3f3ef17b0bdacf4e9eb3e7900aca (diff) | |
download | ffmpeg-bde1fc5386282142697dbaf91fe57744ba63fec1.tar.gz |
hwcontext_vulkan: host wait on semaphores before freeing frame
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r-- | libavutil/hwcontext_vulkan.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 6aba9e3b8e..69de06e6c2 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -112,6 +112,7 @@ enum VulkanExtensions { /* Semaphores */ \ MACRO(1, 1, EXT_EXTERNAL_FD_SEM, GetSemaphoreFdKHR) \ MACRO(1, 1, EXT_NO_FLAG, CreateSemaphore) \ + MACRO(1, 1, EXT_NO_FLAG, WaitSemaphores) \ MACRO(1, 1, EXT_NO_FLAG, DestroySemaphore) \ \ /* Memory */ \ @@ -1737,6 +1738,16 @@ static void vulkan_frame_free(void *opaque, uint8_t *data) VulkanFunctions *vk = &p->vkfn; int planes = av_pix_fmt_count_planes(hwfc->sw_format); + VkSemaphoreWaitInfo wait_info = { + .sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO, + .flags = 0x0, + .pSemaphores = f->sem, + .pValues = f->sem_value, + .semaphoreCount = planes, + }; + + vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX); + vulkan_free_internal(f->internal); for (int i = 0; i < planes; i++) { |