From 9b14ea0aa13ae18f7ef2b91a4e5f2feb0de0794a Mon Sep 17 00:00:00 2001 From: Lynne Date: Thu, 4 Dec 2025 15:02:40 +0100 Subject: [PATCH] vulkan_dpx: fix alignment issue 12-bit images apparently require mod-32 alignment for each line. Go figure. --- libavcodec/vulkan/dpx_unpack.comp | 7 +++++-- libavcodec/vulkan_dpx.c | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libavcodec/vulkan/dpx_unpack.comp b/libavcodec/vulkan/dpx_unpack.comp index 5a44de87bf..b04ce5ddc6 100644 --- a/libavcodec/vulkan/dpx_unpack.comp +++ b/libavcodec/vulkan/dpx_unpack.comp @@ -44,8 +44,11 @@ i16vec4 parse_packed_in_32(ivec2 pos, int stride) #else i16vec4 parse_packed_in_32(ivec2 pos, int stride) { - uint line_off = pos.y*(stride*BITS_PER_COMP*COMPONENTS + - (need_align << 3)); + uint line_size = stride*BITS_PER_COMP*COMPONENTS; + line_size += line_size & 31; + line_size += need_align << 3; + + uint line_off = pos.y*line_size; uint pix_off = pos.x*BITS_PER_COMP*COMPONENTS; uint off = (line_off + pix_off >> 5); diff --git a/libavcodec/vulkan_dpx.c b/libavcodec/vulkan_dpx.c index 54774f2424..16ac10c5b8 100644 --- a/libavcodec/vulkan_dpx.c +++ b/libavcodec/vulkan_dpx.c @@ -402,9 +402,7 @@ static int vk_decode_dpx_init(AVCodecContext *avctx) switch (dpx->pix_fmt) { case AV_PIX_FMT_GRAY10: - case AV_PIX_FMT_GRAY12: case AV_PIX_FMT_GBRAP10: - case AV_PIX_FMT_GBRAP12: case AV_PIX_FMT_UYVY422: case AV_PIX_FMT_YUV444P: case AV_PIX_FMT_YUVA444P: