xamarin / urho

Code to integrate with the Urho3D engine
Other
462 stars 122 forks source link

Backgrounding the app throws GLDRendererMetal error #245

Closed Slm0nB closed 7 years ago

Slm0nB commented 7 years ago

Hi

When I background my app containing an urho surface i receive the following error (iPad 2017 running 10.3)

GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=7 "Insufficient Permission (to submit GPU work from background) (IOAF code 6)" UserInfo={NSLocalizedDescription=Insufficient Permission (to submit GPU work from background) (IOAF code 6)}

The error looks a like the one described here: https://developer.apple.com/library/content/qa/qa1766/_index.html

Is this a bug, or am I doing something wrong? I have looked into calling on Exit() (The documentation states it is a no-op on iOS)

Setup: Xamarin.Forms 2.3.4.267 UrhoSharp 1.5.22

Any help will be appreciated Simon

Slm0nB commented 7 years ago

Found a solution.

Calling UrhoSurface.OnPause() right before the app goes into the background (OnSleep()) and then UrhoSurface.OnResume() when the app gets focus (OnResume())