PR #22908 opened by llyyr URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22908 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22908.patch
See individual commits >From 51660ad52361befd3c7e55b4d4b5af7e399150af Mon Sep 17 00:00:00 2001 From: llyyr <[email protected]> Date: Fri, 24 Apr 2026 16:00:11 +0530 Subject: [PATCH 1/2] libavutil/vulkan: replace GetDeviceQueue with GetDeviceQueue2 vkGetDeviceQueue2 with flags = 0 is equivalent to vkGetDeviceQueue and is available since Vulkan 1.1. Needed to support queues created with non-zero VkDeviceQueueCreateFlags. Fixes VUID-vkGetDeviceQueue-flags-01841 VVL error. --- libavutil/vulkan.c | 12 +++++++++++- libavutil/vulkan_functions.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 1ffde91745..44ae1dc6df 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -507,7 +507,17 @@ int ff_vk_exec_pool_init(FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf, /* Queue index distribution */ e->qi = i % qf->num; e->qf = qf->idx; - vk->GetDeviceQueue(s->hwctx->act_dev, qf->idx, e->qi, &e->queue); + VkDeviceQueueInfo2 qinfo = { + .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2, +#ifdef VK_KHR_internally_synchronized_queues + .flags = (s->extensions & FF_VK_EXT_INTERNAL_QUEUE_SYNC) + ? VK_DEVICE_QUEUE_CREATE_INTERNALLY_SYNCHRONIZED_BIT_KHR + : 0, +#endif + .queueFamilyIndex = qf->idx, + .queueIndex = e->qi, + }; + vk->GetDeviceQueue2(s->hwctx->act_dev, &qinfo, &e->queue); } return 0; diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h index 3c4deef0a2..86dff046b2 100644 --- a/libavutil/vulkan_functions.h +++ b/libavutil/vulkan_functions.h @@ -121,7 +121,7 @@ typedef uint64_t FFVulkanExtensions; MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdDispatchBase) \ \ /* Queue */ \ - MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetDeviceQueue) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetDeviceQueue2) \ MACRO(1, 1, FF_VK_EXT_NO_FLAG, QueueSubmit) \ MACRO(1, 1, FF_VK_EXT_NO_FLAG, QueueSubmit2) \ \ -- 2.52.0 >From 5134b0aceba7d019c3cb27381801afdd81352a99 Mon Sep 17 00:00:00 2001 From: llyyr <[email protected]> Date: Fri, 24 Apr 2026 16:02:35 +0530 Subject: [PATCH 2/2] libavutil/hwcontext_vulkan: fix internal queue sync device creation 6f811ad never set VK_DEVICE_QUEUE_CREATE_INTERNALLY_SYNCHRONIZED_BIT_KHR on the queues at vkCreateDevice. Without the flag, the driver doesn't actually synchronizes queues. Fixes: 6f811ad751bf ("hwcontext_vulkan: implement internal queue synchronization") --- libavutil/hwcontext_vulkan.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index d6395d2841..291708c3b3 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -1726,8 +1726,14 @@ static int setup_queue_families(AVHWDeviceContext *ctx, VkDeviceCreateInfo *cd) weights[j] = 1.0; pc = (VkDeviceQueueCreateInfo *)cd->pQueueCreateInfos; + VkDeviceQueueCreateFlags qflags = 0; +#ifdef VK_KHR_internally_synchronized_queues + if (p->vkctx.extensions & FF_VK_EXT_INTERNAL_QUEUE_SYNC) + qflags |= VK_DEVICE_QUEUE_CREATE_INTERNALLY_SYNCHRONIZED_BIT_KHR; +#endif pc[cd->queueCreateInfoCount++] = (VkDeviceQueueCreateInfo) { .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, + .flags = qflags, .queueFamilyIndex = hwctx->qf[i].idx, .queueCount = hwctx->qf[i].num, .pQueuePriorities = weights, -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
