This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit bb5c461a4732c48d947921d535e843ea67e84035
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu May 28 11:40:25 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 2 13:32:44 2026 +0200

    avfilter/vf_libplacebo: setup pl_vulkan_queue.flags on import params
    
    libplacebo versions before v365 passed .flags = 0 when retrieving the queues
    from imported Vulkan devices, so we have to error out in the case of a 
mismatch
    to avoid undefined behavior (Vulkan spec).
    
    See-Also: https://code.videolan.org/videolan/libplacebo/-/merge_requests/856
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 libavfilter/vf_libplacebo.c | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 117bfd21b4..fcbbd74c4e 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -707,6 +707,21 @@ static void input_uninit(LibplaceboInput *input)
     av_fifo_freep2(&input->out_pts);
 }
 
+static int copy_pl_queue(const AVVulkanDeviceContext *hwctx,
+                         const AVVulkanDeviceQueueFamily *qf,
+                         struct pl_vulkan_queue *pl_qf)
+{
+    pl_qf->index = qf->idx;
+    pl_qf->count = qf->num;
+#if PL_API_VER >= 365
+    pl_qf->flags = hwctx->queue_flags;
+#else
+    if (hwctx->queue_flags != 0)
+        return AVERROR(EINVAL); // prevent undefined behavior
+#endif
+    return 0;
+}
+
 static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext 
*hwctx)
 {
     int err = 0;
@@ -735,19 +750,12 @@ static int init_vulkan(AVFilterContext *avctx, const 
AVVulkanDeviceContext *hwct
         };
         for (int i = 0; i < hwctx->nb_qf; i++) {
             const AVVulkanDeviceQueueFamily *qf = &hwctx->qf[i];
-
-            if (qf->flags & VK_QUEUE_GRAPHICS_BIT) {
-                import_params.queue_graphics.index = qf->idx;
-                import_params.queue_graphics.count = qf->num;
-            }
-            if (qf->flags & VK_QUEUE_COMPUTE_BIT) {
-                import_params.queue_compute.index = qf->idx;
-                import_params.queue_compute.count = qf->num;
-            }
-            if (qf->flags & VK_QUEUE_TRANSFER_BIT) {
-                import_params.queue_transfer.index = qf->idx;
-                import_params.queue_transfer.count = qf->num;
-            }
+            if (qf->flags & VK_QUEUE_GRAPHICS_BIT)
+                RET(copy_pl_queue(hwctx, qf, &import_params.queue_graphics));
+            if (qf->flags & VK_QUEUE_COMPUTE_BIT)
+                RET(copy_pl_queue(hwctx, qf, &import_params.queue_compute));
+            if (qf->flags & VK_QUEUE_TRANSFER_BIT)
+                RET(copy_pl_queue(hwctx, qf, &import_params.queue_transfer));
         }
 
         /* Import libavfilter vulkan context into libplacebo */

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to