summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_cuda.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-04-29 02:44:41 +0200
committerLynne <dev@lynne.ee>2021-04-30 00:08:37 +0200
commit4a6581e968d38f009140e055e29be9953279cc7b (patch)
tree91a96c59009bbd787319bea9310682e7c266bca6 /libavutil/hwcontext_cuda.c
parentffeeff4fbccbf9c9269ac24fe56285b224426141 (diff)
hwcontext_vulkan: dynamically load functions
This patch allows for alternative loader implementations.
Diffstat (limited to 'libavutil/hwcontext_cuda.c')
-rw-r--r--libavutil/hwcontext_cuda.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c
index cfdf2d7fd4..48f7ecbdd3 100644
--- a/libavutil/hwcontext_cuda.c
+++ b/libavutil/hwcontext_cuda.c
@@ -427,16 +427,19 @@ static int cuda_device_derive(AVHWDeviceContext *device_ctx,
switch (src_ctx->type) {
#if CONFIG_VULKAN
+#define TYPE PFN_vkGetPhysicalDeviceProperties2
case AV_HWDEVICE_TYPE_VULKAN: {
AVVulkanDeviceContext *vkctx = src_ctx->hwctx;
+ TYPE prop_fn = (TYPE)vkctx->get_proc_addr(vkctx->inst, "vkGetPhysicalDeviceProperties2");
VkPhysicalDeviceProperties2 vk_dev_props = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
.pNext = &vk_idp,
};
- vkGetPhysicalDeviceProperties2(vkctx->phys_dev, &vk_dev_props);
+ prop_fn(vkctx->phys_dev, &vk_dev_props);
src_uuid = vk_idp.deviceUUID;
break;
}
+#undef TYPE
#endif
default:
return AVERROR(ENOSYS);