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

Git pushed a commit to branch master
in repository ffmpeg.

commit b7e8611b2a6a035ca79afd2818962518126265da
Author:     Lynne <[email protected]>
AuthorDate: Sun Aug 16 19:50:52 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Mon Aug 17 14:57:07 2026 +0900

    vulkan: enable unified image layouts when supported
    
    Enables VK_KHR_unified_image_layouts when available, and queries its
    feature bits into FFVulkanContext. The extension guarantees that using
    the GENERAL image layout comes with no performance penalty, with the
    unifiedImageLayoutsVideo feature extending this to video usage.
---
 libavutil/hwcontext_vulkan.c | 14 ++++++++++++++
 libavutil/vulkan.c           |  4 ++++
 libavutil/vulkan.h           |  3 +++
 libavutil/vulkan_functions.h |  1 +
 libavutil/vulkan_loader.h    |  3 +++
 5 files changed, 25 insertions(+)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 008d4b4bb6..2b671beb2a 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -106,6 +106,9 @@ typedef struct VulkanDeviceFeatures {
 #ifdef VK_KHR_maintenance9
     VkPhysicalDeviceMaintenance9FeaturesKHR maintenance_9;
 #endif
+#ifdef VK_KHR_unified_image_layouts
+    VkPhysicalDeviceUnifiedImageLayoutsFeaturesKHR unified_layouts;
+#endif
 
     VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maintenance_1;
 #ifdef VK_KHR_video_maintenance2
@@ -282,6 +285,10 @@ static void device_features_init(AVHWDeviceContext *ctx, 
VulkanDeviceFeatures *f
     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
+#ifdef VK_KHR_unified_image_layouts
+    FF_VK_STRUCT_EXT(s, &feats->device, &feats->unified_layouts, 
FF_VK_EXT_UNIFIED_IMAGE_LAYOUTS,
+                     
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFIED_IMAGE_LAYOUTS_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);
@@ -428,6 +435,10 @@ static void 
device_features_copy_needed(VulkanDeviceFeatures *dst, VulkanDeviceF
 #ifdef VK_KHR_maintenance9
     COPY_VAL(maintenance_9.maintenance9);
 #endif
+#ifdef VK_KHR_unified_image_layouts
+    COPY_VAL(unified_layouts.unifiedImageLayouts);
+    COPY_VAL(unified_layouts.unifiedImageLayoutsVideo);
+#endif
 
 #ifdef VK_KHR_internally_synchronized_queues
     COPY_VAL(internal_queue_sync.internallySynchronizedQueues);
@@ -754,6 +765,9 @@ static const VulkanOptExtension optional_device_exts[] = {
 #endif
 #ifdef VK_KHR_maintenance9
     { VK_KHR_MAINTENANCE_9_EXTENSION_NAME,                    
FF_VK_EXT_MAINTENANCE_9          },
+#endif
+#ifdef VK_KHR_unified_image_layouts
+    { VK_KHR_UNIFIED_IMAGE_LAYOUTS_EXTENSION_NAME,            
FF_VK_EXT_UNIFIED_IMAGE_LAYOUTS  },
 #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 62a0f6b259..021b8d989c 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -187,6 +187,10 @@ int ff_vk_load_props(FFVulkanContext *s)
                      VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES);
     FF_VK_STRUCT_EXT(s, &s->feats, &s->atomic_float_feats, 
FF_VK_EXT_ATOMIC_FLOAT,
                      
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_FLOAT_FEATURES_EXT);
+#ifdef VK_KHR_unified_image_layouts
+    FF_VK_STRUCT_EXT(s, &s->feats, &s->unified_layout_feats, 
FF_VK_EXT_UNIFIED_IMAGE_LAYOUTS,
+                     
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFIED_IMAGE_LAYOUTS_FEATURES_KHR);
+#endif
 
     if (!s->imageviews_pool) {
         s->imageviews_pool = 
av_refstruct_pool_alloc_ext(sizeof(FFVkImageViews), 0,
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index 9a1147cf28..1952965c89 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -327,6 +327,9 @@ typedef struct FFVulkanContext {
     AVRefStructPool *imageviews_pool;
 
     VkPhysicalDeviceVulkan12Features feats_12;
+#ifdef VK_KHR_unified_image_layouts
+    VkPhysicalDeviceUnifiedImageLayoutsFeaturesKHR unified_layout_feats;
+#endif
     VkPhysicalDeviceFeatures2 feats;
 
     VkMemoryPropertyFlagBits host_cached_flag;
diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h
index 4835038514..ff4076e9f5 100644
--- a/libavutil/vulkan_functions.h
+++ b/libavutil/vulkan_functions.h
@@ -56,6 +56,7 @@ typedef uint64_t FFVulkanExtensions;
 #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 */
+#define FF_VK_EXT_UNIFIED_IMAGE_LAYOUTS  (1ULL << 26) /* 
VK_KHR_unified_image_layouts */
 
 /* 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 0d5858ce33..f1dbd7fee1 100644
--- a/libavutil/vulkan_loader.h
+++ b/libavutil/vulkan_loader.h
@@ -99,6 +99,9 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * 
const *extensions,
 #ifdef VK_KHR_maintenance9
         { VK_KHR_MAINTENANCE_9_EXTENSION_NAME,             
FF_VK_EXT_MAINTENANCE_9          },
 #endif
+#ifdef VK_KHR_unified_image_layouts
+        { VK_KHR_UNIFIED_IMAGE_LAYOUTS_EXTENSION_NAME,     
FF_VK_EXT_UNIFIED_IMAGE_LAYOUTS  },
+#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]

Reply via email to