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

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

Conversation

@AlirezaHadjar

Copy link
Copy Markdown
Contributor

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

@wcandillon

Copy link
Copy Markdown
Owner

Thank you for this, I need to think about it a bit more deeper

@wcandillon

Copy link
Copy Markdown
Owner

@AlirezaHadjar just wanted to tell you that I am not dropping this issue. Currently looking at the same issue on Skia Graphite, once we fix there, I will circle back on this one. It just need a bit of more designing

This branch has not been deployed

No deployments
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

2 participants