summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard S. Wright Jr. <richard@lunarg.com>2024-02-28 11:58:06 -0500
committerRichard S. Wright Jr. <richard@lunarg.com>2024-02-28 11:58:06 -0500
commit0fb67ac2433db404a54da2ba6e0042d38cdbf883 (patch)
treed4f58a6863938945633e41f20142a10b4f2c7238
parent5982311be42f8277cad11ae4637c80ab69c79ce5 (diff)
downloadvolk-0fb67ac2433db404a54da2ba6e0042d38cdbf883.tar.gz
apple: Add support for loader or moltenvk in a framework
-rw-r--r--volk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/volk.c b/volk.c
index 802ba08..b097b1e 100644
--- a/volk.c
+++ b/volk.c
@@ -72,6 +72,12 @@ VkResult volkInitialize(void)
module = dlopen("libvulkan.1.dylib", RTLD_NOW | RTLD_LOCAL);
if (!module)
module = dlopen("libMoltenVK.dylib", RTLD_NOW | RTLD_LOCAL);
+ // Add support for using Vulkan and MoltenVK in a Framework. App store rules for iOS
+ // strictly enforce no .dylib's. If they aren't found it just falls through
+ if (!module)
+ module = dlopen("vulkan.framework/vulkan", RTLD_NOW | RTLD_LOCAL);
+ if (!module)
+ module = dlopen("MoltenVK.framework/MoltenVK", RTLD_NOW | RTLD_LOCAL);
// modern versions of macOS don't search /usr/local/lib automatically contrary to what man dlopen says
// Vulkan SDK uses this as the system-wide installation location, so we're going to fallback to this if all else fails
if (!module && getenv("DYLD_FALLBACK_LIBRARY_PATH") == NULL)