This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 0baa71b53c avutil/hwcontext_vulkan: query the actual image format in 
try_export_flags
0baa71b53c is described below

commit 0baa71b53cd9dc6ecf0cf9a5c271bcbde04135ba
Author:     Zhao Zhili <[email protected]>
AuthorDate: Thu Jul 9 22:19:44 2026 +0800
Commit:     Zhao Zhili <[email protected]>
CommitDate: Fri Jul 10 03:20:20 2026 +0000

    avutil/hwcontext_vulkan: query the actual image format in try_export_flags
    
    GetPhysicalDeviceImageFormatProperties2() must be queried with the format
    that will actually be used to create the image, otherwise the external
    memory export capability check answers for a different format than the one
    being allocated.
    
    When AV_VK_FRAME_FLAG_DISABLE_MULTIPLANE is set (e.g. by ffplay for CUDA
    interop), vulkan_frames_init selects the per-plane fallback format via
    vkfmt_from_pixfmt2(disable_multiplane=1) and stores it in hwctx->format[].
    The image is then created with that fallback format. Querying the
    multiplane vkf instead returns capability for a format that is never
    instantiated, and on NVIDIA GPUs with OPTIMAL tiling the answer differs
    between the two formats, producing broken CUDA hwaccel output.
    
    Read hwctx->format[0], which is populated by vulkan_frames_init before
    vulkan_pool_alloc runs, so the query matches the image regardless of
    whether the multiplane or fallback path was taken.
    
    Fix artifacts with `ffplay -hwaccel cuda foo.mp4`.
---
 libavutil/hwcontext_vulkan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 2de2de7e93..3da0d3c04d 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2799,7 +2799,7 @@ static void try_export_flags(AVHWFramesContext *hwfc,
     VkPhysicalDeviceImageFormatInfo2 pinfo = {
         .sType  = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
         .pNext  = !exp ? NULL : &enext,
-        .format = vk_find_format_entry(hwfc->sw_format)->vkf,
+        .format = hwctx->format[0],
         .type   = VK_IMAGE_TYPE_2D,
         .tiling = hwctx->tiling,
         .usage  = hwctx->usage,

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

Reply via email to