Replies: 2 comments 1 reply
-
There's a bug in vulkan.hpp and how it loads the library from the loader that doesn't exist in volk. When I originally worked on getting iOS support, I remember running into this. I coded around it by explicitly telling vulkan.hpp to use the framework. Vulkan-Samples/framework/vulkan_sample.h Line 1012 in fdce530 The local fix here could be to add TARGET_OS_SIMULATOR to the check on system type. |
Beta Was this translation helpful? Give feedback.
-
The partial "fix" for running the samples out of the box for iOS-Simulator ended up being a change to the explicit file name that @gpx1000 mentioned above within Vulkan-Samples/framework/vulkan_sample.h from "vulkan.framework/vulkan" to "MoltenVK.framework/MoltenVK" under the #if TARGET_OS_IPHONE check. This is a quick fix and still does not allow a lot of the samples to run, just more than only hello_triangle when you build and run for iOS-Sim out of the box. |
Beta Was this translation helpful? Give feedback.
-
I am trying to get the samples to run on iOS Simulator on my MacBook through Xcode 15.4. I can get everything to work fine by following the instructions on this repo and a few other resources, up until I go to run the application with different samples. I can build and run the application but almost none of the samples work. The only sample I can seem to run without errors is hello_triangle in samples/api. The sample hpp_hello_triangle for example runs and prints the following to the terminal:
And after some investigation, it seems that the hello_triangle sample (the one that works) goes to initialize volk, and loads the vulkan library by searching for different library names, supporting the Frameworks path within the application bundle:
And the hpp_hello_triangle sample (the one that doesn't work) uses the vulkan.hpp header file's DynamicLoader class to load the vulkan library when creating an instance, but cannot find it because it only tries finding the library with a .dylib extension and has no sense of the Frameworks path included in an iOS app bundle (see defined(__APPLE__) sections):
And because m_library will be NULL since the library is in the Frameworks folder in the application bundle, it throws the runtime error. Now, I know iOS doesn't allow the use of .dylib libraries, so that leads me to think I have the project in the wrong configuration or that all the samples that error out like this just aren't supported yet.
Can anyone help me understand how to get the iOS version of the samples to work or if they are even suppose to? How can I edit the Xcode project build for iOS to not assume system libraries? Is this expected behavior since using the Vulkan headers assumes using .dylib libraries? Any insight would help me greatly as this is my first time working with iOS applications and Vulkan. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions