Commit b7e835e069 for ffmpeg
commit b7e835e06913e4374a4567003fe8c75cebfffb98
Author: Jack Boykin <jtboykin.jb@gmail.com>
Date: Sun Oct 11 09:49:15 2026 -0500
vulkan_decode: keep DRM modifiers off the DPB pool when DISTINCT is set
With DPB_AND_OUTPUT_DISTINCT, DPB images never leave the decoder, but the
pool still copied the output's DRM modifier list and tiling. Drivers
needn't support modifier tiling for DPB-only usage, and radv doesn't, so
the pool broke VUID-VkImageCreateInfo-pNext-06811.
Regression since: 25e187f849
Assisted-by: Claude Opus 5.5
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 34ca4dc565..5cf338b0d3 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -1343,12 +1343,12 @@ int ff_vk_decode_init(AVCodecContext *avctx)
VkImageTiling tiling = VK_IMAGE_TILING_OPTIMAL;
void *create_pnext = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext,
VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR);
- /* Reference (DPB) images use the same tiling and pNext chain as output.
- * If VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR is 0, the
- * driver does not support separate output and DPB with different layouts/tiling. */
+ /* With DPB_AND_OUTPUT_DISTINCT, DPB images never leave the decoder,
+ * so they don't need the output's DRM modifiers. */
void *drm_create_pnext = (void *)ff_vk_find_struct(ctx->s.hwfc->create_pnext,
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT);
- if (drm_create_pnext) {
+ if (drm_create_pnext &&
+ !(ctx->dec_caps.flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR)) {
create_pnext = drm_create_pnext;
tiling = VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT;
av_assert2(ff_vk_find_struct(drm_create_pnext, VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR));