PR #24488 opened by t-boiko
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24488
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24488.patch

After d06e381534, Vulkan decode failed to init on NVIDIA Ampere
(COINCIDE-only, no SEPARATE_REFERENCE_IMAGES). Spec only requires one
of COINCIDE or DISTINCT (layered DPB is required when separate refs
are not advertised). Keep the coincide path instead of treating this
as a buggy driver.


>From 54e7ef195e2a3bf6368b5552a898360e720bea66 Mon Sep 17 00:00:00 2001
From: Tymur Boiko <[email protected]>
Date: Mon, 14 Sep 2026 21:31:55 +0300
Subject: [PATCH] vulkan_decode: don't fail COINCIDE-only profiles without
 separate refs

d06e381534 made the COINCIDE-only sanity check actually fire. It treated
DPB_AND_OUTPUT_COINCIDE without SEPARATE_REFERENCE_IMAGES as a buggy
driver and returned AVERROR_EXTERNAL.

That combination is legal. chapters/video/decode.adoc requires only one
of COINCIDE or DISTINCT. chapters/videocoding.adoc: without
SEPARATE_REFERENCE_IMAGES all DPB slots must be layers of one VkImage
(VUID-VkVideoBeginCodingInfoKHR-flags-07244).

NVIDIA Ampere (NVDEC 5.0, e.g. RTX 3090) reports exactly this for every
decode profile. Keep the check as a verbose note and continue with the
existing coincide path (output images as DPB slots).

Signed-off-by: Tymur Boiko <[email protected]>
---
 libavcodec/vulkan_decode.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index ab313423e5..7b5caaa096 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -1000,10 +1000,9 @@ static int vulkan_decode_get_profile(AVCodecContext 
*avctx, AVBufferRef *frames_
                                    
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR)) ==
                                    
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR &&
                !(caps->flags & 
VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR)) {
-        av_log(avctx, AV_LOG_ERROR, "Cannot initialize Vulkan decoding 
session, buggy driver: "
-               "VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR set 
"
-               "but VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR is 
unset!\n");
-        return AVERROR_EXTERNAL;
+        av_log(avctx, AV_LOG_VERBOSE,
+               "COINCIDE-only decode without SEPARATE_REFERENCE_IMAGES "
+               "(layered DPB capability); continuing\n");
     }
 
     dec->dedicated_dpb = !!(dec_caps->flags & 
VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR);
-- 
2.52.0

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

Reply via email to