Miscellaneous emscripten fixes
Series of emscripten-specific fixes:
- Increase
STACK_SIZEto 128 kB from 64 kB (was causing crashes, especially on startup) - Re-scale horizontal scroll values so that scroll speed (approximately) matches desktop
- Fix NULL pointer dereference
- Increase
PTHREAD_POOL_SIZEfrom 4 to 8 (may be unnecessary)
If the pthread pool size change may be unnecessary, why is it made?
imgui_impl_glfw.cpp is sourced from ImGui. Please submit your changes to ImGui first. I don't want to maintain yet another patch on foreign sources.
If the pthread pool size change may be unnecessary, why is it made?
The thread pool is definitely being exhausted, but I don't know enough about Tracy's usage of threads to know when it depends on being able to execute all its threads concurrently.
Happy to remove the change if you'd prefer.
imgui_impl_glfw.cppis sourced from ImGui. Please submit your changes to ImGui first. I don't want to maintain yet another patch on foreign sources.
Fair enough - I've submitted https://github.com/ocornut/imgui/pull/6096
The thread pool is definitely being exhausted, but I don't know enough about Tracy's usage of threads to know when it depends on being able to execute all its threads concurrently.
Happy to remove the change if you'd prefer.
I have seen some weird problems related to threads, but these were mainly on Chrome-based browsers. Firefox seems to handle this much better.
There are already some ifdefs to minimize thread usage with emscripten, but maybe this is not enough?
https://github.com/wolfpld/tracy/blob/e4bd88c/server/TracyWorker.cpp#L1271-L1277
Good point. I'll try to investigate this weekend and see I can track down where the threads are being started