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

Main thread is blocked when rendering for Playground app on macOS and iOS #1006

Closed
bghgary opened this issue Feb 17, 2022 · 3 comments
Closed
Assignees
Milestone

Comments

@bghgary
Copy link
Contributor

bghgary commented Feb 17, 2022

The playground app on macOS and iOS:

if (graphics)
{
graphics->StartRenderingCurrentFrame();
update->Start();
update->Finish();
graphics->FinishRenderingCurrentFrame();
}
}

if (graphics) {
graphics->StartRenderingCurrentFrame();
update->Start();
update->Finish();
graphics->FinishRenderingCurrentFrame();
}

The code is currently calling FinishRenderingCurrentFrame immediately following StartRenderingCurrentFrame. FinishedRenderingCurrentFrame will immediately block waiting for the JS thread to finish doing its part. Ideally, these calls should be backwards. StartRenderingCurrentFrame should be called as soon as possible and FinishRenderingCurrentFrame should be called as late as possible. There should be a small gap between FinishRenderingCurrentFrame and the next StartRenderingCurrentFrame.

Oddly, the validation tests for macOS and iOS does it correctly:

if (graphics)
{
update->Finish();
graphics->FinishRenderingCurrentFrame();
graphics->StartRenderingCurrentFrame();
update->Start();
}

if (graphics) {
update->Finish();
graphics->FinishRenderingCurrentFrame();
graphics->StartRenderingCurrentFrame();
update->Start();
}

@bghgary
Copy link
Contributor Author

bghgary commented Feb 17, 2022

Related: BabylonJS/BabylonReactNative#343

@CedricGuillemet
Copy link
Contributor

This is a resize issue because RenderTarget and other resources are still being used while resize occurs.
Issue doesn't appear with VT because there is no resize allowed there.

@thomlucc thomlucc added the 6.0 label Sep 23, 2022
@thomlucc thomlucc added this to the 6.0 milestone Sep 23, 2022
@thomlucc thomlucc removed the 6.0 label Sep 23, 2022
@bghgary bghgary self-assigned this Oct 13, 2022
@thomlucc thomlucc modified the milestones: 6.0, 7.0 Mar 14, 2023
@thomlucc
Copy link
Member

fixed

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

No branches or pull requests

3 participants