mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-09 13:19:00 +00:00
vk_platform: Remove workaround to use Vulkan loader on macOS. (#3484)
This commit is contained in:
@@ -226,8 +226,7 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e
|
|||||||
bool enable_crash_diagnostic) {
|
bool enable_crash_diagnostic) {
|
||||||
LOG_INFO(Render_Vulkan, "Creating vulkan instance");
|
LOG_INFO(Render_Vulkan, "Creating vulkan instance");
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) && !defined(ENABLE_QT_GUI)
|
||||||
#ifndef ENABLE_QT_GUI
|
|
||||||
// Initialize the environment with the path to the MoltenVK ICD, so that the loader will
|
// Initialize the environment with the path to the MoltenVK ICD, so that the loader will
|
||||||
// find it.
|
// find it.
|
||||||
static const auto icd_path = [] {
|
static const auto icd_path = [] {
|
||||||
@@ -238,17 +237,8 @@ vk::UniqueInstance CreateInstance(Frontend::WindowSystemType window_type, bool e
|
|||||||
}();
|
}();
|
||||||
setenv("VK_DRIVER_FILES", icd_path.c_str(), true);
|
setenv("VK_DRIVER_FILES", icd_path.c_str(), true);
|
||||||
#endif
|
#endif
|
||||||
// If the Vulkan loader exists in /usr/local/lib, give it priority. The Vulkan SDK
|
|
||||||
// installs it here by default, but it is not in the default library search path.
|
|
||||||
// The loader has a clause to check for it, but at a lower priority than the bundled
|
|
||||||
// libMoltenVK.dylib, so we need to handle it ourselves to give it priority.
|
|
||||||
static const std::string usr_local_path = "/usr/local/lib/libvulkan.dylib";
|
|
||||||
static vk::detail::DynamicLoader dl = std::filesystem::exists(usr_local_path)
|
|
||||||
? vk::detail::DynamicLoader(usr_local_path)
|
|
||||||
: vk::detail::DynamicLoader();
|
|
||||||
#else
|
|
||||||
static vk::detail::DynamicLoader dl;
|
static vk::detail::DynamicLoader dl;
|
||||||
#endif
|
|
||||||
VULKAN_HPP_DEFAULT_DISPATCHER.init(
|
VULKAN_HPP_DEFAULT_DISPATCHER.init(
|
||||||
dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr"));
|
dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user