BabylonReactNative icon indicating copy to clipboard operation
BabylonReactNative copied to clipboard

Main thread is blocked when rendering

Open bghgary opened this issue 3 years ago • 0 comments
trafficstars

See https://github.com/BabylonJS/BabylonReactNative/blob/b3716d9dd7538ecf56ae670a311fba5b0d4b90b8/Modules/%40babylonjs/react-native/shared/BabylonNative.cpp#L116-L119

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.

bghgary avatar Feb 17 '22 01:02 bghgary