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 {
47 #ifdef VK_KHR_shader_relaxed_extended_instruction
63 { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY },
64 { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM },
80 for (
int i = 0;
i < nb_extensions;
i++) {
82 if (!strcmp(extensions[
i], extension_map[j].
name)) {
83 mask |= extension_map[j].flag;
107 uint64_t extensions_mask,
108 int has_inst,
int has_dev)
112 static const struct FunctionLoadInfo {
115 uint16_t struct_offset;
125 #define FUNC_NAME(req_inst, req_dev, ext_flag, name) "vk"#name"\0"
135 const struct FunctionLoadInfo *load = &vk_load_info[
i];
136 static const char extensions[][4] = {
"",
"EXT",
"KHR" };
137 PFN_vkVoidFunction
fn;
139 if (load->req_dev && !has_dev)
141 if (load->req_inst && !has_inst)
148 n =
snprintf(ext_name,
sizeof(ext_name),
"%s%s",
name, extensions[j]);
152 fn = vk->GetDeviceProcAddr(hwctx->
act_dev, ext_name);
153 else if (load->req_inst)
164 "as supported, but got NULL function pointer!\n",
name);
168 *(PFN_vkVoidFunction *)((uint8_t *)vk + load->struct_offset) =
fn;