PR #24368 opened by vytskalt URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24368 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24368.patch
In `try_export_flags`, when probing for support for image export capability, pass the `VkVideoProfileListInfoKHR` and `VkImageFormatListCreateInfo` to `GetPhysicalDeviceImageFormatProperties2` if they exist from the user supplied `create_pnext`. I ran into this when putting `VkImageFormatListCreateInfo` in my `create_pnext`, but still getting this validation error: ``` Validation Error: [ VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02313 ] | MessageID = 0x2a31f4c8 vkGetPhysicalDeviceImageFormatProperties2(): pImageFormatInfo tiling is VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT and flags contain VK_I MAGE_CREATE_MUTABLE_FORMAT_BIT bit, but the pNext chain does not contain an instance of VkImageFormatListCreateInfo with non-zero view FormatCount. The Vulkan spec states: If tiling is VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT and flags contains VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, th en the pNext chain must include a VkImageFormatListCreateInfo structure with non-zero viewFormatCount (https://docs.vulkan.org/spec/la test/chapters/capabilities.html#VUID-VkPhysicalDeviceImageFormatInfo2-tiling-02313) Objects: 1 [0] VkPhysicalDevice 0x13440fe0 ``` Code was copied from [vulkan_host_transfer_usable](https://code.ffmpeg.org/FFmpeg/FFmpeg/src/commit/7ee873656cb5fc489c6d2966e45d448ca30aedda/libavutil/hwcontext_vulkan.c#L3052-L3070) >From 3c6ab8fd6334bb01eefb4134de8e7b8c669f0a7f Mon Sep 17 00:00:00 2001 From: vytskalt <[email protected]> Date: Fri, 4 Sep 2026 22:04:18 +0300 Subject: [PATCH] avutil/hwcontext_vulkan: forward video profile and image format list in try_export_flags --- libavutil/hwcontext_vulkan.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 2e0e526041..10a000471e 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -2875,6 +2875,26 @@ static void try_export_flags(AVHWFramesContext *hwfc, (hwctx->img_flags) : hwctx->img_flags ? hwctx->img_flags : (VkImageCreateFlags)(VK_IMAGE_CREATE_ALIAS_BIT), }; + VkVideoProfileListInfoKHR profile_list; + const VkVideoProfileListInfoKHR *pl = + ff_vk_find_struct(hwctx->create_pnext, + VK_STRUCTURE_TYPE_VIDEO_PROFILE_LIST_INFO_KHR); + if (pl) { + profile_list = *pl; + profile_list.pNext = NULL; + ff_vk_link_struct(&pinfo, &profile_list); + } + + VkImageFormatListCreateInfo format_list; + const VkImageFormatListCreateInfo *fl = + ff_vk_find_struct(hwctx->create_pnext, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO); + if (fl) { + format_list = *fl; + format_list.pNext = NULL; + ff_vk_link_struct(&pinfo, &format_list); + } + nb_mods = has_mods ? drm_mod_info->drmFormatModifierCount : 1; for (int i = 0; i < nb_mods; i++) { if (has_mods) -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- [email protected] To unsubscribe send an email to [email protected]
