Skip to content

fix(ios): run surface transitions on main thread - #459

Open
AlirezaHadjar wants to merge 2 commits into
wcandillon:mainfrom
AlirezaHadjar:ios/main-thread-surface-transitions
Open

fix(ios): run surface transitions on main thread#459
AlirezaHadjar wants to merge 2 commits into
wcandillon:mainfrom
AlirezaHadjar:ios/main-thread-surface-transitions

Conversation

@AlirezaHadjar

Copy link
Copy Markdown

Fixes #458.

Moves Apple surface transitions to the main thread and retains detached surface state until the frame that acquired it reaches present. This fixes Core Animation thread confinement and prevents teardown from racing getCurrentTexture() / queue.submit().

Validated on an iPhone 16 Pro Max with five 60-second Xcode Activity Monitor runs and 750 total remounts:

  • mean app CPU: 31.78% to 16.64% (-47.7%)
  • physical footprint: about 20 to 24 MiB lower

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: surface configuration mutates CAMetalLayer off the main thread

1 participant