renderer_vulkan: Revert vkGetInstanceProcAddr symbol change for MoltenVK. (#7341)

This commit is contained in:
Steveice10 2024-01-12 09:16:04 -08:00 committed by GitHub
parent 19d5695aa3
commit 37f0a7484f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 13 deletions

View file

@ -121,7 +121,7 @@ function(download_moltenvk)
set(MOLTENVK_TAR "${CMAKE_BINARY_DIR}/externals/MoltenVK.tar")
if (NOT EXISTS ${MOLTENVK_DIR})
if (NOT EXISTS ${MOLTENVK_TAR})
file(DOWNLOAD https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.7-rc1/MoltenVK-all.tar
file(DOWNLOAD https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.7-rc2/MoltenVK-all.tar
${MOLTENVK_TAR} SHOW_PROGRESS)
endif()

View file

@ -283,21 +283,10 @@ vk::UniqueInstance CreateInstance(const Common::DynamicLibrary& library,
throw std::runtime_error("Failed to load Vulkan driver library");
}
auto vkGetInstanceProcAddr =
const auto vkGetInstanceProcAddr =
library.GetSymbol<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
if (!vkGetInstanceProcAddr) {
#ifdef __APPLE__
// MoltenVK now hides most Vulkan symbols by default to avoid clashes,
// so we may need to use the ICD hook instead.
vkGetInstanceProcAddr =
library.GetSymbol<PFN_vkGetInstanceProcAddr>("vk_icdGetInstanceProcAddr");
if (!vkGetInstanceProcAddr) {
throw std::runtime_error(
"Failed GetSymbol vkGetInstanceProcAddr or vk_icdGetInstanceProcAddr");
}
#else
throw std::runtime_error("Failed GetSymbol vkGetInstanceProcAddr");
#endif
}
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);