From: Lynne <dev@lynne.ee> To: ffmpeg-devel@ffmpeg.org Cc: Lynne <dev@lynne.ee> Subject: [FFmpeg-devel] [PATCH 2/2] hwcontext_vulkan: enable unified image layouts Date: Tue, 17 Jun 2025 04:30:23 +0900 Message-ID: <20250616193040.2517489-2-dev@lynne.ee> (raw) In-Reply-To: <20250616193040.2517489-1-dev@lynne.ee> --- libavutil/hwcontext_vulkan.c | 11 +++++++++++ libavutil/vulkan_functions.h | 1 + libavutil/vulkan_loader.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index f05b75110d..dcca217af3 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -81,6 +81,9 @@ typedef struct VulkanDeviceFeatures { VkPhysicalDeviceTimelineSemaphoreFeatures timeline_semaphore; VkPhysicalDeviceShaderSubgroupRotateFeaturesKHR subgroup_rotate; VkPhysicalDeviceHostImageCopyFeaturesEXT host_image_copy; +#ifdef VK_KHR_unified_image_layouts + VkPhysicalDeviceUnifiedImageLayoutsFeaturesKHR unified_image_layouts; +#endif #ifdef VK_KHR_shader_expect_assume VkPhysicalDeviceShaderExpectAssumeFeaturesKHR expect_assume; @@ -212,6 +215,10 @@ static void device_features_init(AVHWDeviceContext *ctx, VulkanDeviceFeatures *f VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_ROTATE_FEATURES_KHR); FF_VK_STRUCT_EXT(s, &feats->device, &feats->host_image_copy, FF_VK_EXT_HOST_IMAGE_COPY, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES_EXT); +#ifdef VK_KHR_unified_image_layouts + FF_VK_STRUCT_EXT(s, &feats->device, &feats->unified_image_layouts, FF_VK_EXT_UNIFIED_IMG_LAYOUTS, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFIED_IMAGE_LAYOUTS_FEATURES_KHR); +#endif #ifdef VK_KHR_shader_expect_assume FF_VK_STRUCT_EXT(s, &feats->device, &feats->expect_assume, FF_VK_EXT_EXPECT_ASSUME, @@ -289,6 +296,10 @@ static void device_features_copy_needed(VulkanDeviceFeatures *dst, VulkanDeviceF COPY_VAL(timeline_semaphore.timelineSemaphore); COPY_VAL(subgroup_rotate.shaderSubgroupRotate); COPY_VAL(host_image_copy.hostImageCopy); +#ifdef VK_KHR_unified_image_layouts + COPY_VAL(unified_image_layouts.unifiedImageLayouts); + COPY_VAL(unified_image_layouts.unifiedImageLayoutsVideo); +#endif COPY_VAL(video_maintenance_1.videoMaintenance1); #ifdef VK_KHR_video_maintenance2 diff --git a/libavutil/vulkan_functions.h b/libavutil/vulkan_functions.h index 68fa7b802d..5094fe3a80 100644 --- a/libavutil/vulkan_functions.h +++ b/libavutil/vulkan_functions.h @@ -50,6 +50,7 @@ typedef uint64_t FFVulkanExtensions; #define FF_VK_EXT_EXPECT_ASSUME (1ULL << 16) /* VK_KHR_shader_expect_assume */ #define FF_VK_EXT_SUBGROUP_ROTATE (1ULL << 17) /* VK_KHR_shader_subgroup_rotate */ #define FF_VK_EXT_HOST_IMAGE_COPY (1ULL << 18) /* VK_EXT_host_image_copy */ +#define FF_VK_EXT_UNIFIED_IMG_LAYOUTS (1ULL << 19) /* VK_KHR_unified_image_laouys */ /* 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 7e805fdd4c..3f8edff8a9 100644 --- a/libavutil/vulkan_loader.h +++ b/libavutil/vulkan_loader.h @@ -60,6 +60,9 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions, { VK_EXT_SHADER_OBJECT_EXTENSION_NAME, FF_VK_EXT_SHADER_OBJECT }, { VK_KHR_SHADER_SUBGROUP_ROTATE_EXTENSION_NAME, FF_VK_EXT_SUBGROUP_ROTATE }, { VK_EXT_HOST_IMAGE_COPY_EXTENSION_NAME, FF_VK_EXT_HOST_IMAGE_COPY }, +#ifdef VK_KHR_unified_image_layouts + { VK_KHR_UNIFIED_IMAGE_LAYOUTS_EXTENSION_NAME, FF_VK_EXT_UNIFIED_IMG_LAYOUTS }, +#endif { VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME, FF_VK_EXT_VIDEO_MAINTENANCE_1 }, #ifdef VK_KHR_video_maintenance2 { VK_KHR_VIDEO_MAINTENANCE_2_EXTENSION_NAME, FF_VK_EXT_VIDEO_MAINTENANCE_2 }, -- 2.49.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2025-06-16 19:31 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-06-16 19:30 [FFmpeg-devel] [PATCH 1/2] hwcontext_vulkan: add workaround for BROKEN nvidia crap Lynne 2025-06-16 19:30 ` Lynne [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20250616193040.2517489-2-dev@lynne.ee \ --to=dev@lynne.ee \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git