| 
7 | 7 | 
 
  | 
8 | 8 | // See https://github.com/KhronosGroup/Vulkan-Hpp?tab=readme-ov-file#extensions--per-device-function-pointers-  | 
9 | 9 | #define VULKAN_HPP_DISPATCH_LOADER_DYNAMIC 1  | 
 | 10 | +// We use VULKAN_HPP_DEFAULT_DISPATCHER, but not VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE  | 
 | 11 | +// to avoid conflicts with applications or other libraries who might use it.  | 
 | 12 | +namespace vk::detail { class DispatchLoaderDynamic; }  | 
 | 13 | +vk::detail::DispatchLoaderDynamic & ggml_vk_default_dispatcher();  | 
 | 14 | +#define VULKAN_HPP_DEFAULT_DISPATCHER ggml_vk_default_dispatcher()  | 
10 | 15 | 
 
  | 
11 | 16 | #include <vulkan/vulkan.hpp>  | 
12 | 17 | 
 
  | 
13 |  | -// See https://github.com/KhronosGroup/Vulkan-Hpp?tab=readme-ov-file#extensions--per-device-function-pointers-  | 
14 |  | -VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE  | 
15 |  | - | 
16 | 18 | #include <algorithm>  | 
17 | 19 | #include <cmath>  | 
18 | 20 | #include <iomanip>  | 
@@ -4498,14 +4500,20 @@ static bool ggml_vk_instance_portability_enumeration_ext_available(const std::ve  | 
4498 | 4500 | static bool ggml_vk_instance_debug_utils_ext_available(const std::vector<vk::ExtensionProperties> & instance_extensions);  | 
4499 | 4501 | static bool ggml_vk_device_is_supported(const vk::PhysicalDevice & vkdev);  | 
4500 | 4502 | 
 
  | 
 | 4503 | +static vk::detail::DispatchLoaderDynamic ggml_vk_default_dispatcher_instance;  | 
 | 4504 | + | 
 | 4505 | +vk::detail::DispatchLoaderDynamic & ggml_vk_default_dispatcher() {  | 
 | 4506 | +    return ggml_vk_default_dispatcher_instance;  | 
 | 4507 | +}  | 
 | 4508 | + | 
4501 | 4509 | static void ggml_vk_instance_init() {  | 
4502 | 4510 |     if (vk_instance_initialized) {  | 
4503 | 4511 |         return;  | 
4504 | 4512 |     }  | 
4505 | 4513 |     VK_LOG_DEBUG("ggml_vk_instance_init()");  | 
4506 | 4514 | 
 
  | 
4507 | 4515 |     // See https://github.com/KhronosGroup/Vulkan-Hpp?tab=readme-ov-file#extensions--per-device-function-pointers-  | 
4508 |  | -    VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);  | 
 | 4516 | +    ggml_vk_default_dispatcher_instance.init(vkGetInstanceProcAddr);  | 
4509 | 4517 | 
 
  | 
4510 | 4518 |     uint32_t api_version = vk::enumerateInstanceVersion();  | 
4511 | 4519 | 
 
  | 
 | 
0 commit comments