Android UI not responding when loading larger GLB model
- Dominant language
- C++
- Stars
- 20.5k
- Forks
- 2.3k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 74
Description
⚠️ **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 in `This thread has not been adopted` when executing `ResourceLoader::Impl::computeTangents`
Engine has been created from main thread so as per the below comment in `Engine.cpp`,
```
// we're assuming we're on the main thread here.
// (it may not be the case)
mJobSystem.adopt();
```
only the thread from which the Engine is created will be adopted by the `JobSystem` which eventually blocks the UI when loading larger model
**To 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):**
- OS: Android
```
FEngine resolved backend: OpenGL
QUALCOMM build : 8e5405b, I57aaec3440
Build Date : 05/21/21
OpenGL ES Shader Compiler Version: EV031.32.02.10
Local Branch : mybranchebba1dbe-451b-f160-ac81-1458d0b52ae8
Remote Branch : quic/gfx-adreno.lnx.1.0.r135-rel
Remote Branch : NONE
Reconstruct Branch : NOTHING
Build Config : S P 10.0.7 AArch64
Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
PFP: 0x016ee190, ME: 0x00000000
[Qualcomm], [Adreno (TM) 630], [OpenGL ES 3.2 V@0502.0 (GIT@8e5405b, I57aaec3440, 1621601959) (Date:05/21/21)], [OpenGL ES GLSL ES 3.20]
```
**Smartphone (please complete the following information):**
- Device: OnePlus 6T/6GB RAM
- OS: Android 11
**Additional context**
Sorry couldn't attach the glb file as it is confidential
Contributor guide
Assessment
This issue has not been assessed yet.