Closed TheMostDiligent closed 2 months ago
I managed to figured out what was the problem: the default stack size set by Emscripten was insufficient. Increasing the stack size solved the problem:
target_link_options(MyWebApp PRIVATE "SHELL: -s STACK_SIZE=5MB")
What was the default stack size being used by emscripten? I would be concerned if glslang is blowing a reasonably sized stack, on the other hand if the default stack is tiny on this one platform, that's not really glslang's problem.
What was the default stack size being used by emscripten?
I was not able to find this in the documentation.
I would be concerned if glslang is blowing a reasonably sized stack
glslang.js does not set the stack size. If you only use it for size testing, that is OK. However, compiling complex shaders may overflow the stack as was in our case, so you may consider setting this option too.
Found it, the default stack size is 64 Kb.
Thanks. That really is pretty small, I believe Windows uses 1 MB as the default and Linux uses 2 MB for threads other than the main one, so I would not consider this a glslang issue. If you want to add a note about this to the README section about emscripten, that could be helpful for anyone who runs into this issue in the future.
@arcady-lunarg: #3584
Hello!
I am trying to enable glslang on WebASM (Emscripten) and the build goes well. However, at run time, glslang crashes with the following stack:
Also, somehow if I set the
ENABLE_GLSLANG_JS=ON
(I don't use or need the glslang.js), it starts to work for some shaders, but still crashes for others. I don't understand how this setting may affect other targets.Could you please suggest what I may be missing?