From 554dcc2885de79a9010227138eb95fba612849a1 Mon Sep 17 00:00:00 2001 From: Lynne Date: Tue, 31 Mar 2026 17:40:35 +0200 Subject: [PATCH] vf_scale_vulkan: make sure that pixfmts are different when using swscale The swscale internals currently have a quirk which causes the memcpy backend to be called when the pixfmts match. Obviously, this doesn't do what is expected, as hardware frames cannot just be copied. Check for this. Sponsored-by: Sovereign Tech Fund --- libavfilter/vf_scale_vulkan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index bc3841c8f7..1a78ad948d 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -447,7 +447,8 @@ static int scale_vulkan_config_output(AVFilterLink *outlink) av_log(avctx, AV_LOG_ERROR, "Scaling is not supported with debayering\n"); return AVERROR_PATCHWELCOME; } - } else if (inlink->w == outlink->w || inlink->h == outlink->h) { + } else if ((inlink->w == outlink->w || inlink->h == outlink->h) && + (s->vkctx.input_format != s->vkctx.output_format)) { s->sws = sws_alloc_context(); if (!s->sws) return AVERROR(ENOMEM);