Repository navigation
Crossy Road: lay a shown window out in the next pass, and UIScreen's EDR headroom - #459
Merged
Merged
Conversation
…de makeKeyAndVisible The first tick laid the app's views out while -makeKeyAndVisible was still running. iOS draws a shown window at the run loop's next turn.
…does Unity's -[UnityView layoutSubviews] makes its keyboard delegate, and +[KeyboardDelegate Initialize], which Unity calls once -makeKeyAndVisible returns, asserts when one exists (Crossy Road). A program that waits in its launch method for its view's layout runs the run loop, which runs the pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Crossy Road 7.14.3 (Unity on Metal) aborted at start-up on the Duet 3:
Unity's
-createUIcalls-makeKeyAndVisible, then+[KeyboardDelegate Initialize]. Perry laid the window out inside-makeKeyAndVisible, twice over: the display's first tick ran inline when the first window showed, and-makeKeyAndVisiblecalled-layoutIfNeeded.-[UnityView layoutSubviews]makes the keyboard delegate (+Instance), so+Initializefound one and asserted. On iOS the window is laid out at the run loop's next commit, after the call returns, or every Unity game would hit this.Display.startIfWantedstarts the display timer instead of callingtick()inline, in both the compositor and X11 paths.-[UIWindow makeKeyAndVisible]schedules a pass (Updates.schedule()) instead oflayoutIfNeeded().-[UIScreen potentialEDRHeadroom]andcurrentEDRHeadroomreturn 1, a standard-range display; Crossy Road aborted on the first next.Risk: f4215f6 added the synchronous layout so Sonic & SEGA All-Stars Racing, which waits in its launch method for what its view's
layoutSubviewssets up, would draw. If it waits by running the run loop, the pass still reaches it; if it spins without the run loop, it would stop drawing. Not retested here.Tested on the Duet 3 with master (258bff1, built in the Parallels VM) plus these changes: Crossy Road starts and draws its title screen, and ran over 3 minutes. One earlier run segfaulted about 37 seconds in, after an ad SDK's interstitial callback; the next didn't, so there is no crash report yet. Play is untested.