This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 888430127108501f6408df14b0d4c4e04fb9afe4 Author: Lynne <[email protected]> AuthorDate: Sun Aug 16 17:55:42 2026 +0900 Commit: Lynne <[email protected]> CommitDate: Mon Aug 17 14:57:01 2026 +0900 vulkan: enable maintenance9 when supported Enables VK_KHR_maintenance9 when available. The feature of interest is that queue family ownership transfers become optional for resources created with exclusive sharing mode, with their contents preserved when accessed by another queue family. For optimal-tiling images, this is only guaranteed between queue families flagged in VkQueueFamilyOwnershipTransferPropertiesKHR, so query it for each queue family alongside the other properties. --- libavutil/hwcontext_vulkan.c | 16 ++++++++++++++++ libavutil/vulkan.c | 17 +++++++++++++++++ libavutil/vulkan.h | 3 +++ libavutil/vulkan_functions.h | 1 + libavutil/vulkan_loader.h | 3 +++ 5 files changed, 40 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index acd6d4c3be..a9ebd96b7a 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -103,6 +103,10 @@ typedef struct VulkanDeviceFeatures { VkPhysicalDeviceShaderMaximalReconvergenceFeaturesKHR maximal_reconvergence; #endif +#ifdef VK_KHR_maintenance9 + VkPhysicalDeviceMaintenance9FeaturesKHR maintenance_9; +#endif + VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maintenance_1; #ifdef VK_KHR_video_maintenance2 VkPhysicalDeviceVideoMaintenance2FeaturesKHR video_maintenance_2; @@ -274,6 +278,11 @@ static void device_features_init(AVHWDeviceContext *ctx, VulkanDeviceFeatures *f VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_MAXIMAL_RECONVERGENCE_FEATURES_KHR); #endif +#ifdef VK_KHR_maintenance9 + FF_VK_STRUCT_EXT(s, &feats->device, &feats->maintenance_9, FF_VK_EXT_MAINTENANCE_9, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_9_FEATURES_KHR); +#endif + FF_VK_STRUCT_EXT(s, &feats->device, &feats->video_maintenance_1, FF_VK_EXT_VIDEO_MAINTENANCE_1, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR); #ifdef VK_KHR_video_maintenance2 @@ -416,6 +425,10 @@ static void device_features_copy_needed(VulkanDeviceFeatures *dst, VulkanDeviceF COPY_VAL(maximal_reconvergence.shaderMaximalReconvergence); #endif +#ifdef VK_KHR_maintenance9 + COPY_VAL(maintenance_9.maintenance9); +#endif + #ifdef VK_KHR_internally_synchronized_queues COPY_VAL(internal_queue_sync.internallySynchronizedQueues); #endif @@ -738,6 +751,9 @@ static const VulkanOptExtension optional_device_exts[] = { #endif #ifdef VK_KHR_shader_maximal_reconvergence { VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_EXTENSION_NAME, FF_VK_EXT_MAXIMAL_RECONVERGENCE }, +#endif +#ifdef VK_KHR_maintenance9 + { VK_KHR_MAINTENANCE_9_EXTENSION_NAME, FF_VK_EXT_MAINTENANCE_9 }, #endif { VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME, FF_VK_EXT_VIDEO_MAINTENANCE_1 }, #ifdef VK_KHR_video_maintenance2 diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 71e0c6f8f2..d2308a7278 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -259,6 +259,16 @@ int ff_vk_load_props(FFVulkanContext *s) return AVERROR(ENOMEM); } +#ifdef VK_KHR_maintenance9 + s->ownership_props = av_calloc(s->tot_nb_qfs, sizeof(*s->ownership_props)); + if (!s->ownership_props) { + av_freep(&s->qf_props); + av_freep(&s->query_props); + av_freep(&s->video_props); + return AVERROR(ENOMEM); + } +#endif + for (uint32_t i = 0; i < s->tot_nb_qfs; i++) { s->qf_props[i] = (VkQueueFamilyProperties2) { .sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2, @@ -268,6 +278,10 @@ int ff_vk_load_props(FFVulkanContext *s) VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR); FF_VK_STRUCT_EXT(s, &s->qf_props[i], &s->video_props[i], FF_VK_EXT_VIDEO_QUEUE, VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR); +#ifdef VK_KHR_maintenance9 + FF_VK_STRUCT_EXT(s, &s->qf_props[i], &s->ownership_props[i], FF_VK_EXT_MAINTENANCE_9, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_OWNERSHIP_TRANSFER_PROPERTIES_KHR); +#endif } vk->GetPhysicalDeviceQueueFamilyProperties2(s->hwctx->phys_dev, &s->tot_nb_qfs, s->qf_props); @@ -2640,6 +2654,9 @@ void ff_vk_uninit(FFVulkanContext *s) av_freep(&s->query_props); av_freep(&s->qf_props); av_freep(&s->video_props); +#ifdef VK_KHR_maintenance9 + av_freep(&s->ownership_props); +#endif av_freep(&s->coop_mat_props); av_freep(&s->host_image_copy_layouts); av_refstruct_pool_uninit(&s->imageviews_pool); diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index e0dc60746b..64142e0575 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -308,6 +308,9 @@ typedef struct FFVulkanContext { #endif VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; VkQueueFamilyVideoPropertiesKHR *video_props; +#ifdef VK_KHR_maintenance9 + VkQueueFamilyOwnershipTransferPropertiesKHR *ownership_props; +#endif VkQueueFamilyProperties2 *qf_props; int tot_nb_qfs; VkPhysicalDeviceHostImageCopyPropertiesEXT host_image_props; diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h index c7d5ebddfa..5b6fc09e5d 100644 --- a/libavutil/vulkan_functions.h +++ b/libavutil/vulkan_functions.h @@ -55,6 +55,7 @@ typedef uint64_t FFVulkanExtensions; #define FF_VK_EXT_LONG_VECTOR (1ULL << 22) /* VK_EXT_shader_long_vector */ #define FF_VK_EXT_INTERNAL_QUEUE_SYNC (1ULL << 23) /* VK_KHR_internally_synchronized_queues */ #define FF_VK_EXT_MAXIMAL_RECONVERGENCE (1ULL << 24) /* VK_KHR_shader_maximal_reconvergence */ +#define FF_VK_EXT_MAINTENANCE_9 (1ULL << 25) /* VK_KHR_maintenance9 */ /* Video extensions */ #define FF_VK_EXT_VIDEO_QUEUE (1ULL << 36) /* VK_KHR_video_queue */ diff --git a/libavutil/vulkan_loader.h b/libavutil/vulkan_loader.h index c311804f0d..0d5858ce33 100644 --- a/libavutil/vulkan_loader.h +++ b/libavutil/vulkan_loader.h @@ -96,6 +96,9 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions, #ifdef VK_KHR_shader_maximal_reconvergence { VK_KHR_SHADER_MAXIMAL_RECONVERGENCE_EXTENSION_NAME, FF_VK_EXT_MAXIMAL_RECONVERGENCE }, #endif +#ifdef VK_KHR_maintenance9 + { VK_KHR_MAINTENANCE_9_EXTENSION_NAME, FF_VK_EXT_MAINTENANCE_9 }, +#endif #ifdef VK_KHR_video_encode_av1 { VK_KHR_VIDEO_ENCODE_AV1_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_AV1 }, #endif -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
