Reputation: 41
Using GPUImage3 framwork on iOS 13 ,
I have these errors:
Touch the screen of the simulator -> error. `Error: MPS does not support the iOS simulator.'
Can't run simulator using metal kit?
Thank you.
Upvotes: 3
Views: 530
Reputation: 4426
Starting with iOS 13 the simulator now supports Metal but without Metal Performance Shaders.
If you want to run GPUImage3 on the simulator you can change this:
if #available(iOS 9, macOS 10.13, *) {
self.metalPerformanceShadersAreSupported = MPSSupportsMTLDevice(device)
} else {
self.metalPerformanceShadersAreSupported = false
}
to the following:
#if targetEnvironment(simulator)
self.metalPerformanceShadersAreSupported = false
#else
if #available(iOS 9, macOS 10.13, *) {
self.metalPerformanceShadersAreSupported = MPSSupportsMTLDevice(device)
} else {
self.metalPerformanceShadersAreSupported = false
}
#endif
Upvotes: 2
Reputation: 2132
According to Developing Metal Apps that Run in Simulator:
In Xcode 11, Simulator adds support for Metal development. You can write iOS and tvOS apps that use Metal and test them in the Simulator, gaining the benefits of hardware acceleration on the Mac during development of your app.
and Supporting Simulator in a Metal App
I guess this crash related to framework GPUImage3, but..I tried to run the code from Apple. The app crashes, unfortunately.
updated: MetalPerformanceShaders is not supported on the simulator currently.
Upvotes: 1