We have an app that uses MTL to render. This app works correctly on devices running iOS11. When using the same app on devices running iOS12, we started getting glitches and sometimes hangs in the rendering. We also tried recompiling for iOS12 and are getting the same bad behavior. On the console we are getting the following different messages:
2018-09-22 09:22:29.508576-0500 OurApp [1286:84481] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)
2018-09-22 09:29:55.654426-0500 OurApp [1286:84625] Execution of the command buffer was aborted due to an error during execution. Caused GPU Hang Error (IOAF code 3)
2018-09-22 09:34:37.718054-0500 OurApp [1286:87354] Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (IOAF code 4)
With the first two messages the rendering seems glitchy, where a blank screen is presented and then finally the rendering occurs on screen. With the last message the rendering doesn't actually occur and the message continues being displayed until we move to a different view.
This app uses SceneKit, instantiates a SCNView and uses a default CIContext. It also uses the Physically Based Lighting model, which forces the MTL renderer to be used. The app has a simple SCNNode geometry, a cylinder. Each geometry object of the cylinder gets a normal texture (3 in total). The same diffuse, metalness and roughness values are applied to all the geometry objects of the cylinder.
Has anybody ran into this problem? If so, how did you solve it?
Thanks
UPDATE: After a lot of debugging it was found that using an image for environment lighting in a scene (for more realistic reflections) is what is causing the GPU errors. Without environment lighting the GPU errors do not exist. This isn't really a workaround as our app needs realistic reflections.