Closed measuredweighed closed 1 month ago
Thanks for reporting this issue.
I haven't used the build scripts for macOS and iOS in a while and the RunExamplesMacOS.command seem to have broken since I refactored the resource loading to be generic for all platforms.
The error cannot create Metal graphics PSO without valid vertex function
indicates that the vertex shader could not be loaded (a better error message here would be helpful of course). It fails to load it because using the build script doesn't generate the default.metallib file. Xcode will generate it automatically when you build and run from the development environment. I converted the examples to load the shaders this way because it made loading shaders easier on iOS.
The temporary solution would be to generate the project files and then build the examples within Xcode. Just run the build script from the Terminal app and add the -p
argument:
$ ./BuildMacOS.command -p
Once you built the apps you should be able to either run them within Xcode or as you would usually run an app from within Finder.
As for the iOS build issue, I don't know if the newer Xcode versions use a different simulator SDK name or if you haven't installed the simulator yet as this is a separate package and doesn't come with Xcode out of the box as far as I remember.
But if you want to test it on your physical iOS device, you can do the same as for the macOS solution by just generating the project files. The build script is only intended to build for the simulator for testing purposes. If you want to run the examples on a physical device, it's a bit easier to select the connected device within Xcode. Alternatively, you can replace the identifier iphonesimulator
in the build script with whatever name is used in your Xcode installation.
I hope this helps. I will fix the Run*.command script soon.
Thank you for the quick response! I can confirm that BuildMacOS.command -p
seems to work after building the LLGL
, LLGL_Metal
and Example_HelloTriangle
targets.
Unfortunately BuildIOS.command -p
runs into the following issue while launching Example_HelloTriangle for an iOS Simulator via Xcode:
dyld[89890]: Library not loaded: @rpath/libLLGLD.dylib
Referenced from: <783D525B-B085-364B-BB66-52474B056683> /Users/measuredweighed/Library/Developer/CoreSimulator/Devices/{redacted}/data/Containers/Bundle/Application/{redacted}/Example_HelloTriangle.app/Example_HelloTriangle
I can confirm that libLLGLD.dylib
exists inside build_ios/build/Debug
and that the generated xproj contains that path in the Runtime Search Paths.
I haven't seen this error before and I just tried it with a clean build but that worked for me.
Having said that, I do have an older Xcode installation so maybe the default deployment target 11.0 is not the right choice for you. You can change the deployment target by adding -t 13.0
(or other versions) to the build script. Also see -h
/--help
for further options in the build scripts.
Another option would be to build as a static lib (add -s
to the build script), which also simplifies building in Xcode since you only have to build the example targets which automatically builds all dependencies. With dynamic libs on the other hand, you have to build the backend (such as _LLGLMetal) and then the example project separately because all backends are loaded dynamically without the knowledge of Xcode.
Please also note that HelloTriangle is the only example that is currently not supported on iOS because those apps cannot use the plain old main
entry point. I will put that on my TODO list as it's understandably quite confusing that the most basic example is not working. The other ones should be fine, though.
I closed this with 12ebc70 as it fixes the missing default.metallib file for the BuildMacOS.command script. I will work on the other issues separately but feel free to re-open this issue or keep posting updates.
LLGL looks really interesting and I'm keen to dig into it a little more, but I seem to be running into a few problems when trying to compile the library for both iOS and macOS. The provided
BuildIOS.command
fails with the following error:make: *** No rule to make target
iphonesimulator'.`BuildMacOS.command
succeeds, but the examples inbuild_macos/build
all seem to crash on launch. Running the providedRunExamplesMacOS.command
results in the following output:Here's the
BuildIOS.command
output for reference:The build machine is an Apple M1 Pro running macOS
Sonoma 14.5 (23F79)
.