Open mbalajee opened 2 days ago
UI is not blocked when I create the ModelViewer
instance (& so the Engine
instance) in Executors.newSingleThreadExecutor()
& call modelViewer.render
from the same executor. Is this the right way to unblock UI or is there a downside in creating ModelViewer in a non-main thread?
Oh when I back out of the screen I get this error,
Precondition
in shutdown:444
reason: Engine::shutdown() called from the wrong thread!
because ModelViewer destroys the view in addOnAttachStateChangeListener
so I guess it is not as straightforward as operating modelViewer on a non-ui thread
@romainguy would you recommend maintaining a copy of ModelViewer ?
⚠️ Issues not using this template will be systematically closed.
Describe the bug When loading larger models (over 8K entities)
ModelViewer#loadModelGlb
blocks the UI. Calling this function in a different thread results inThis thread has not been adopted
when executingResourceLoader::Impl::computeTangents
Engine has been created from main thread so as per the below comment in
Engine.cpp
,only the thread from which the Engine is created will be adopted by the
JobSystem
which eventually blocks the UI when loading larger modelTo Reproduce Steps to reproduce the behavior: Loading a larger model hangs the entire UI, can't exit out of the screen
Expected behavior UI should not be blocked
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Sorry couldn't attach the glb file as it is confidential