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 {
56 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY },
57 { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM },
72 for (
int i = 0;
i < nb_extensions;
i++) {
74 if (!strcmp(extensions[
i], extension_map[j].
name)) {
75 mask |= extension_map[j].flag;
99 uint64_t extensions_mask,
100 int has_inst,
int has_dev)
104 static const struct FunctionLoadInfo {
107 uint16_t struct_offset;
117 #define FUNC_NAME(req_inst, req_dev, ext_flag, name) "vk"#name"\0"
127 const struct FunctionLoadInfo *load = &vk_load_info[
i];
128 static const char extensions[][4] = {
"",
"EXT",
"KHR" };
129 PFN_vkVoidFunction
fn;
131 if (load->req_dev && !has_dev)
133 if (load->req_inst && !has_inst)
140 n =
snprintf(ext_name,
sizeof(ext_name),
"%s%s",
name, extensions[j]);
144 fn = vk->GetDeviceProcAddr(hwctx->
act_dev, ext_name);
145 else if (load->req_inst)
156 "as supported, but got NULL function pointer!\n",
name);
160 *(PFN_vkVoidFunction *)((uint8_t *)vk + load->struct_offset) =
fn;