| | |
| | | PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; |
| | | |
| | | if (_this->vulkan_config.loader_handle) { |
| | | SDL_SetError("Vulkan/MoltenVK already loaded"); |
| | | return -1; |
| | | return SDL_SetError("Vulkan/MoltenVK already loaded"); |
| | | } |
| | | |
| | | /* Load the Vulkan loader library */ |
| | |
| | | _this->vulkan_config.loader_handle = DEFAULT_HANDLE; |
| | | } else { |
| | | const char** paths; |
| | | const char *foundPath = NULL; |
| | | int numPaths; |
| | | int i; |
| | | |
| | |
| | | numPaths = SDL_arraysize(defaultPaths); |
| | | } |
| | | |
| | | for (i=0; i < numPaths; i++) { |
| | | _this->vulkan_config.loader_handle = SDL_LoadObject(paths[i]); |
| | | if (_this->vulkan_config.loader_handle) |
| | | break; |
| | | else |
| | | continue; |
| | | for (i = 0; i < numPaths && _this->vulkan_config.loader_handle == NULL; i++) { |
| | | foundPath = paths[i]; |
| | | _this->vulkan_config.loader_handle = SDL_LoadObject(foundPath); |
| | | } |
| | | if (i == numPaths) |
| | | return -1; |
| | | |
| | | SDL_strlcpy(_this->vulkan_config.loader_path, paths[i], |
| | | if (_this->vulkan_config.loader_handle == NULL) { |
| | | return SDL_SetError("Failed to load Vulkan/MoltenVK library"); |
| | | } |
| | | |
| | | SDL_strlcpy(_this->vulkan_config.loader_path, foundPath, |
| | | SDL_arraysize(_this->vulkan_config.loader_path)); |
| | | vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_LoadFunction( |
| | | _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); |