diff --git a/meson.build b/meson.build index 3bca70e637..b7bcb1b0ba 100644 --- a/meson.build +++ b/meson.build @@ -1280,14 +1280,16 @@ vulkan_opt = get_option('vulkan').require( libplacebo.get_variable('pl_has_vulkan', default_value: '0') == '1', error_message: 'libplacebo compiled without vulkan support!', ) -vulkan = dependency('vulkan', version: '>= 1.1.70', required: vulkan_opt) +# libplacebo/ffmpeg public headers depend on Vulkan 1.3 +vulkan = dependency('vulkan', version: '>= 1.3.238', required: vulkan_opt) features += {'vulkan': vulkan.found() and (vulkan.type_name() == 'internal' or cc.has_header_symbol('vulkan/vulkan_core.h', - 'VK_VERSION_1_1', + 'VK_VERSION_1_3', dependencies: vulkan))} if features['vulkan'] dependencies += vulkan - sources += files('video/out/vulkan/context.c', + sources += files('video/out/hwdec/hwdec_vulkan.c', + 'video/out/vulkan/context.c', 'video/out/vulkan/utils.c', 'video/filter/vf_gpu_vulkan.c') endif @@ -1358,15 +1360,6 @@ if features['android-media-ndk'] sources += files('video/out/hwdec/hwdec_aimagereader.c') endif -vulkan_interop = get_option('vulkan-interop').require( - features['vulkan'] and vulkan.version().version_compare('>=1.3.238'), - error_message: 'Vulkan Interop requires vulkan headers >= 1.3.238', -) -features += {'vulkan-interop': vulkan_interop.allowed()} -if features['vulkan-interop'] - sources += files('video/out/hwdec/hwdec_vulkan.c') -endif - d3d_hwaccel = get_option('d3d-hwaccel').require( win32, error_message: 'the os is not win32!', diff --git a/meson_options.txt b/meson_options.txt index 7ff9262d20..c6e6337d68 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -103,7 +103,6 @@ option('gl-dxinterop-d3d9', type: 'feature', value: 'auto', description: 'OpenGL option('ios-gl', type: 'feature', value: 'auto', description: 'iOS OpenGL ES interop support') option('videotoolbox-gl', type: 'feature', value: 'auto', description: 'Videotoolbox with OpenGL') option('videotoolbox-pl', type: 'feature', value: 'auto', description: 'Videotoolbox with libplacebo') -option('vulkan-interop', type: 'feature', value: 'auto', description: 'Vulkan graphics interop') # macOS features option('macos-10-15-4-features', type: 'feature', value: 'auto', description: 'macOS 10.15.4 SDK Features') diff --git a/video/mp_image_pool.c b/video/mp_image_pool.c index 922854a7d1..3d44a0897c 100644 --- a/video/mp_image_pool.c +++ b/video/mp_image_pool.c @@ -23,7 +23,7 @@ #include #include -#if HAVE_VULKAN_INTEROP +#if HAVE_VULKAN #include #endif #include @@ -393,7 +393,7 @@ bool mp_update_av_hw_frames_pool(struct AVBufferRef **hw_frames_ctx, hw_frames->width = w; hw_frames->height = h; -#if HAVE_VULKAN_INTEROP +#if HAVE_VULKAN if (format == AV_PIX_FMT_VULKAN && disable_multiplane) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(sw_format); if ((desc->flags & AV_PIX_FMT_FLAG_PLANAR) && diff --git a/video/out/gpu/hwdec.c b/video/out/gpu/hwdec.c index a929e678f8..4fb9711276 100644 --- a/video/out/gpu/hwdec.c +++ b/video/out/gpu/hwdec.c @@ -76,7 +76,7 @@ const struct ra_hwdec_driver *const ra_hwdec_drivers[] = { #if HAVE_ANDROID_MEDIA_NDK &ra_hwdec_aimagereader, #endif -#if HAVE_VULKAN_INTEROP +#if HAVE_VULKAN &ra_hwdec_vulkan, #endif diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index 6ae3a1912f..ae1dac4f87 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -178,7 +178,6 @@ pl_vulkan mppl_create_vulkan(struct vulkan_opts *opts, .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, }; -#if HAVE_VULKAN_INTEROP /* * Request the additional extensions and features required to make full use * of the ffmpeg Vulkan hwcontext and video decoding capability. @@ -208,7 +207,6 @@ pl_vulkan mppl_create_vulkan(struct vulkan_opts *opts, }; features.pNext = &atomic_float_feature; -#endif AVUUID param_uuid = { 0 }; bool is_uuid = opts->device && @@ -223,11 +221,9 @@ pl_vulkan mppl_create_vulkan(struct vulkan_opts *opts, .async_transfer = opts->async_transfer, .async_compute = opts->async_compute, .queue_count = opts->queue_count, -#if HAVE_VULKAN_INTEROP .extra_queues = VK_QUEUE_VIDEO_DECODE_BIT_KHR, .opt_extensions = opt_extensions, .num_opt_extensions = MP_ARRAY_SIZE(opt_extensions), -#endif .features = &features, .device_name = is_uuid ? NULL : opts->device, };