diff options
author | Lynne <dev@lynne.ee> | 2024-12-18 17:27:46 +0900 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-12-23 04:25:09 +0900 |
commit | 1b8cd00da62617bf5e8f2cdac67d99ea6e34404f (patch) | |
tree | 848f0285f12d1b610cc907e125da875826e923b6 /libavutil/hwcontext_vulkan.c | |
parent | 8fbecfd1a044ffd546fefd6d022117d8809d35d4 (diff) | |
download | ffmpeg-1b8cd00da62617bf5e8f2cdac67d99ea6e34404f.tar.gz |
configure: add option to statically link to libvulkan
This may be useful in weird setups and on platforms where
static linking to libvulkan is supported.
libplacebo also has this fallback.
Diffstat (limited to 'libavutil/hwcontext_vulkan.c')
-rw-r--r-- | libavutil/hwcontext_vulkan.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index d32a685383..bc7c258ebb 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -533,11 +533,19 @@ static int vkfmt_from_pixfmt2(AVHWDeviceContext *dev_ctx, enum AVPixelFormat p, return AVERROR(EINVAL); } +#if CONFIG_VULKAN_STATIC +VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, + const char *pName); +#endif + static int load_libvulkan(AVHWDeviceContext *ctx) { VulkanDevicePriv *p = ctx->hwctx; AVVulkanDeviceContext *hwctx = &p->p; +#if CONFIG_VULKAN_STATIC + hwctx->get_proc_addr = vkGetInstanceProcAddr; +#else static const char *lib_names[] = { #if defined(_WIN32) "vulkan-1.dll", @@ -563,6 +571,7 @@ static int load_libvulkan(AVHWDeviceContext *ctx) } hwctx->get_proc_addr = (PFN_vkGetInstanceProcAddr)dlsym(p->libvulkan, "vkGetInstanceProcAddr"); +#endif /* CONFIG_VULKAN_STATIC */ return 0; } |