Closed hrydgard closed 4 months ago
I rebuilt MoltenVK with this setting, and linked to the newly produced binary.
Still the same - not working on iOS 12, working fine on newer iOS.
Dirty patch that fixes the issue, by simply commenting out the call:
// Before macOS 10.15 and iOS 13.0, captureDesc will just be nil
MTLCaptureDescriptor *captureDesc = nil; /* [[MTLCaptureDescriptor new] autorelease];
captureDesc.captureObject = mtlCaptureObject;
captureDesc.destination = MTLCaptureDestinationDeveloperTools;*/
The assertion in the comment clearly isn't right - it causes a linker error on iOS 12 rather than becoming nil.
Any ideas for a real patch? Also, it still doesn't actually work (aborts in VkCreateInstance), but my app launches and can stick with OpenGL on iOS 12 for now.
Seems I'll just disable Vulkan on iOS 12. Getting nonsensical crashes now:
bool mvkSupportsBCTextureCompression(id<MTLDevice> mtlDevice) {
#if MVK_XCODE_14_3 || (MVK_XCODE_12 && MVK_MACOS && !MVK_MACCAT)
if ([mtlDevice respondsToSelector: @selector(supportsBCTextureCompression)]) { // << aborts here
return mtlDevice.supportsBCTextureCompression;
}
#endif
return MVK_MACOS && !MVK_MACCAT;
}
The
README.md
clearly says that "At runtime, MoltenVK requires at least macOS 10.11, iOS 9.0, tvOS 9.0, or visionOS 1.0 (or iOS 11 or tvOS 11 if using IOSurfaces).".
Yes. The documentation is definitely out of date. I'll update that.
In practice, we try to support as far back as current Xcode will build (currently macOS 10.15 & iOS 13), as marked in the target build settings (MoltenVK.xcodeproj
).
To go back to iOS 12 and before, what version of Xcode are you using to build your app and MoltenVK?
And what is the error that occurs on the supportsBCTextureCompression
crash. What feedback do you get?
I'm building with the very latest XCode. It doesn't seem to object to setting the target to 12.0 which is what I do from my CMakeLists.txt that I generate my XCode project from.
Though really, the only reason I'm setting it that far back is that I have an old iPad Air 2 which is interesting as an optimization target because it's so slow, and runs iOS 12 but nothing newer. But I should probably just bump my minimum up to 13.
As for the error, it was some obscure selector error. If it's really interesting I can try to reproduce it again. When I commented out supportsBCTextureCompression it crashed identically on the next thing, so I think it's an ABI mismatch of some sort, MoltenVK presumably being compiled for iOS 13 and something not being compatible. So now I don't even try to start up MoltenVK on iOS 12, I gated it on >= 13.
Anyway, I'll give up on MoltenVK on iOS 12.
Yes. The documentation is definitely out of date. I'll update that.
In practice, we try to support as far back as current Xcode will build (currently macOS 10.15 & iOS 13), as marked in the target build settings (MoltenVK.xcodeproj).
PR #2242 includes these changes to the documentation.
I'm building with the very latest XCode. It doesn't seem to object to setting the target to 12.0 which is what I do from my CMakeLists.txt that I generate my XCode project from.
Though really, the only reason I'm setting it that far back is that I have an old iPad Air 2 which is interesting as an optimization target because it's so slow, and runs iOS 12 but nothing newer. But I should probably just bump my minimum up to 13.
As for the error, it was some obscure selector error. If it's really interesting I can try to reproduce it again. When I commented out supportsBCTextureCompression it crashed identically on the next thing, so I think it's an ABI mismatch of some sort, MoltenVK presumably being compiled for iOS 13 and something not being compatible. So now I don't even try to start up MoltenVK on iOS 12, I gated it on >= 13.
Anyway, I'll give up on MoltenVK on iOS 12.
Okay. Thanks for the background explanation.
If it's really interesting I can try to reproduce it again.
No, that's definitely not needed. It would probably start a process of digging through an indefinite sequence of similar runtime errors. 😉
I'm linking the static xcframework into my app, which works great on newer iOS, but on iOS 12, I get the following:
dyld: Symbol not found: _OBJC_CLASS_$_MTLCaptureDescriptor
MTLCaptureDescriptor
is an iOS 13 API.The README.md clearly says that "At runtime, MoltenVK requires at least macOS 10.11, iOS 9.0, tvOS 9.0, or visionOS 1.0 (or iOS 11 or tvOS 11 if using IOSurfaces).".
This seems be a contradiction - you'd expect the precompiled binaries available in Releases to match what the README says.
I guess I'll have to go rebuild targeting iOS 12 and see if that helps?