Commit 99f1f7347c for ffmpeg
commit 99f1f7347cb95773f97c33b1e050bc537c424ba3
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sun Nov 22 19:59:28 2026 +0000
avfilter/chromaber_vulkan: dispatch every plane and pass the image size to distort_rgba
The compile-time kernel selects the plane through gl_WorkGroupID.z,
but the dispatch still used a single z workgroup (the previous runtime
kernel looped over the planes internally). Only plane 0 was therefore
processed and the chroma planes of multi-planar formats were never
written; they came back as zeroes once the descriptor layout crash was
gone.
In addition distort_rgba() received pos in place of the image size,
so p was constant and every output pixel sampled the same coordinate,
turning RGBA input into a solid color.
Dispatch one workgroup per plane (the same scheme testsrc_vulkan uses
with this plane indexing) and pass the real image size.
Fixes: 8483de2858aa12f7c0d8274634da3e51bb2793da
Assisted-by: Fairy
diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c
index 4dd4fa1d87..c7e74fbda5 100644
--- a/libavfilter/vf_chromaber_vulkan.c
+++ b/libavfilter/vf_chromaber_vulkan.c
@@ -106,6 +106,7 @@ static int chromaber_vulkan_filter_frame(AVFilterLink *link, AVFrame *in)
AVFilterContext *ctx = link->dst;
ChromaticAberrationVulkanContext *s = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
+ const int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out) {
@@ -117,7 +118,7 @@ static int chromaber_vulkan_filter_frame(AVFilterLink *link, AVFrame *in)
RET(init_filter(ctx, in));
RET(ff_vk_filter_process_simple(&s->vkctx, &s->e, &s->shd, out, in,
- s->sampler, 1, &s->opts, sizeof(s->opts)));
+ s->sampler, planes, &s->opts, sizeof(s->opts)));
err = av_frame_copy_props(out, in);
if (err < 0)
diff --git a/libavfilter/vulkan/chromaber.comp.glsl b/libavfilter/vulkan/chromaber.comp.glsl
index d2e4e60f12..74ef7d312e 100644
--- a/libavfilter/vulkan/chromaber.comp.glsl
+++ b/libavfilter/vulkan/chromaber.comp.glsl
@@ -64,7 +64,7 @@ void main()
return;
if (single_plane) {
- distort_rgba(pos, pos);
+ distort_rgba(pos, size);
} else {
vec2 npos = vec2(pos)/vec2(size);
vec4 res = texture(input_img[0], npos);