diff options
author | Philip Langdale <philipl@overt.org> | 2023-05-29 12:40:35 -0700 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2023-05-29 13:26:29 -0700 |
commit | 0131ae4133a2f442fe1906d1632c4b84954c4140 (patch) | |
tree | a61f88aefaa2e4b475a323491a23ff0b93b9f080 /video/out/vulkan | |
parent | ba5370e82a1139a249f27b78d22e8fe4092ad024 (diff) | |
download | mpv-0131ae4133a2f442fe1906d1632c4b84954c4140.tar.bz2 mpv-0131ae4133a2f442fe1906d1632c4b84954c4140.tar.xz |
hwdec_vulkan: simplify requirement checks for Vulkan interop
I originally wrote this trying to avoid doing an explicit version check
on the headers, but it just makes things more confusing, and the
requirements harder to understand.
So, Vulkan interop now takes a dependency on the header release where
they finalised the video decode headers. VK_EXT_descriptor_buffer was
added in 1.3.235, so that's covered as well.
Along the way I fixed a bug in the waf build where it was depending
on libplacebo-next instead of libplacebo-decode.
Diffstat (limited to 'video/out/vulkan')
-rw-r--r-- | video/out/vulkan/context.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/video/out/vulkan/context.c b/video/out/vulkan/context.c index 8bec39cf8c..003515cf32 100644 --- a/video/out/vulkan/context.c +++ b/video/out/vulkan/context.c @@ -161,7 +161,11 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk, p->params = params; p->opts = mp_get_config_group(p, ctx->global, &vulkan_conf); -#if HAVE_VULKAN_INTEROP && defined(VK_EXT_descriptor_buffer) + VkPhysicalDeviceFeatures2 features = { + .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. @@ -189,16 +193,8 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk, .shaderBufferFloat32AtomicAdd = true, }; - VkPhysicalDeviceFeatures2 features = { - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, - .pNext = &atomic_float_feature, - }; - -#else - VkPhysicalDeviceFeatures2 features = { - .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, - }; -#endif // HAVE_VULKAN_INTEROP && defined(VK_EXT_descriptor_buffer) + features.pNext = &atomic_float_feature; +#endif assert(vk->pllog); assert(vk->vkinst); @@ -210,7 +206,7 @@ bool ra_vk_ctx_init(struct ra_ctx *ctx, struct mpvk_ctx *vk, .async_compute = p->opts->async_compute, .queue_count = p->opts->queue_count, .device_name = p->opts->device, -#if HAVE_VULKAN_INTEROP && defined(VK_EXT_descriptor_buffer) +#if HAVE_VULKAN_INTEROP .extra_queues = VK_QUEUE_VIDEO_DECODE_BIT_KHR, .opt_extensions = opt_extensions, .num_opt_extensions = MP_ARRAY_SIZE(opt_extensions), |