19 #ifndef AVUTIL_VULKAN_LOADER_H
20 #define AVUTIL_VULKAN_LOADER_H
28 #define PFN_LOAD_INFO(req_inst, req_dev, ext_flag, name) \
32 offsetof(FFVulkanFunctions, name), \
39 static const struct ExtensionMap {
53 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY },
54 { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM },
66 for (
int i = 0;
i < nb_extensions;
i++) {
68 if (!strcmp(extensions[
i], extension_map[j].
name)) {
69 mask |= extension_map[j].flag;
93 uint64_t extensions_mask,
94 int has_inst,
int has_dev)
98 static const struct FunctionLoadInfo {
101 uint16_t struct_offset;
111 #define FUNC_NAME(req_inst, req_dev, ext_flag, name) "vk"#name"\0"
121 const struct FunctionLoadInfo *load = &vk_load_info[
i];
122 static const char extensions[][4] = {
"",
"EXT",
"KHR" };
123 PFN_vkVoidFunction
fn;
125 if (load->req_dev && !has_dev)
127 if (load->req_inst && !has_inst)
134 n =
snprintf(ext_name,
sizeof(ext_name),
"%s%s",
name, extensions[j]);
138 fn = vk->GetDeviceProcAddr(hwctx->
act_dev, ext_name);
139 else if (load->req_inst)
150 "as supported, but got NULL function pointer!\n",
name);
154 *(PFN_vkVoidFunction *)((uint8_t *)vk + load->struct_offset) =
fn;