From c96d1ee401189188de881f6cd005f9ab45b65834 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 13 Nov 2021 11:11:47 +0100 Subject: [PATCH] hwcontext_vulkan: fix DMABUF import format check call VkExternalImageFormatProperties is required to be present in the .pNext chain of VkImageFormatProperties2, or some drivers crash (RADV). --- libavutil/hwcontext_vulkan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index c054d84a29..fd9d4d481f 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -2329,8 +2329,12 @@ static int vulkan_map_from_drm_frame_desc(AVHWFramesContext *hwfc, AVVkFrame **f }; /* Image format verification */ + VkExternalImageFormatProperties ext_props = { + .sType = VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES_KHR, + }; VkImageFormatProperties2 props_ret = { .sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2, + .pNext = &ext_props, }; VkPhysicalDeviceImageDrmFormatModifierInfoEXT props_drm_mod = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT,