Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move frame encoding to separate thread when possible #829

Merged
merged 18 commits into from Sep 26, 2023

Conversation

elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Sep 19, 2023

Proposed Changes

If no CATransaction sync is needed, perform Picture recorded commands execution on a separate thread.
Fix a freeze on waitUntilScheduled if no transaction is available by moving synchronization from interop scope (any UIView is present in the composition) to per-frame scope (any UIView transaction is issued by composition in current frame).

Testing

Test: N/A

Issues Fixed

Removes work from main thread, when possible, allowing Compose to run there without waiting for CPU to finish encoding GPU commands.
A freeze on waitUntilScheduled during interop synchronization if no transaction is available.

Screenshot 2023-09-19 at 12 13 00 Screenshot 2023-09-19 at 12 13 05

Depends on

#820

@elijah-semyonov elijah-semyonov force-pushed the es/move-frame-encoding-to-separate-thread branch from 2aecc55 to 92b9bd3 Compare September 21, 2023 11:24
@elijah-semyonov elijah-semyonov marked this pull request as draft September 22, 2023 08:44
@elijah-semyonov
Copy link
Author

Back to draft due to:

2023-09-22 10:42:18.195072+0200 VisualEffects[500:43399] Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)
Ignored (for causing prior/excessive GPU errors) (00000004:kIOGPUCommandBufferCallbackErrorSubmissionsIgnored)2023-09-22 10:42:18.195112+0200 VisualEffects[500:43399] Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors)

and freeze on VisualEffects after firework ends.

@elijah-semyonov elijah-semyonov marked this pull request as ready for review September 22, 2023 14:04
@elijah-semyonov elijah-semyonov merged commit cf8b443 into jb-main Sep 26, 2023
2 of 3 checks passed
@elijah-semyonov elijah-semyonov deleted the es/move-frame-encoding-to-separate-thread branch September 26, 2023 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants