I'm experiencing an issue here in Metal that's a bit of a show-stopper for me.
Let's consider using Apple's Game of Life sample found here:
https://developer.apple.com/library/content/samplecode/MetalGameOfLife/Introduction/Intro.html
This compiles and runs fine. However, if one begins manipulating the app's menu items one will see that, when one "lets up" on a given menu item there's a slight pause in the rendering loop. Likewise, for any popup menus in the UI (or new windows as they open/close), lag in the render loop is also an issue.
When one debugs the code, it's apparent that the Metal rendering loop is running on the main thread. This seems typical of all of Apple's sample Metal code. This thread is being blocked during those "dissolve" animations in the menu items.
This really is affecting the viability of my project where I can't have any stuttering of the rendering loop -- for me, it's an AVPlayer's video frames being run through an MTKView. I've gone through the trouble of moving my frame acquistion methods into a CVDisplayLink (ie. off the main thread), only be to flummoxed by this issue.
Is there a way around this? Can the rendering loop be safely moved to a background thread, say, with explicit calls therein to its draw method (eg. with an MTKView's isPaused=YES and enableSetNeedsDisplay=YES).
Any direction on this matter would be appreciated.