At this time, if a NovelRT user vendors MoltenVK for macOS builds, they will need to apply the following workaround for their applications to run:
#if NOVELRT_MOLTENVK_VENDORED
auto icdPath = NovelRT::Utilities::Misc::getExecutablePath() / "MoltenVK_icd.json";setenv("VK_ICD_FILENAMES", icdPath.c_str(), 0);logger.logInfo("macOS detected - setting VK_ICD_FILENAMES to path: {}", icdPath.c_str());
#endif
This is pretty unsightly, but it works to allow MoltenVK to search the proper path and find the ICD file. However, it needs to be done for every sample or other application using NovelRT as a library lest we make macOS throw exceptions due to not initialising Vulkan.
We should find an alternative solution to this that would be more portable and cleaner if we can.
At this time, if a NovelRT user vendors MoltenVK for macOS builds, they will need to apply the following workaround for their applications to run:
#if NOVELRT_MOLTENVK_VENDORED
auto icdPath = NovelRT::Utilities::Misc::getExecutablePath() / "MoltenVK_icd.json";
setenv("VK_ICD_FILENAMES", icdPath.c_str(), 0);
logger.logInfo("macOS detected - setting VK_ICD_FILENAMES to path: {}", icdPath.c_str());
#endif
This is pretty unsightly, but it works to allow MoltenVK to search the proper path and find the ICD file. However, it needs to be done for every sample or other application using NovelRT as a library lest we make macOS throw exceptions due to not initialising Vulkan.
We should find an alternative solution to this that would be more portable and cleaner if we can.