-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webgl calls from worker thread #8846
Comments
I'm not sure how it worked earlier, but WebGL from a worker requires either offscreen canvas (browser support) or offscreen framebuffer (proxying support). Does it work with If that's not it, then as a regression, bisecting might be the fastest way to see what broke this. About libtinfo, there was an issue with that on our linux builds - turns out different linux distros have different versions and they can be incompatible (see for example emscripten-core/emsdk#252). That should be fixed on current builds, but older ones may not work without installing locally some other libtinfo versions for your distro. |
Updated to 1.38.39 and compiled the same code with
It does not crash, but also does not clear the viewport with red, as expected. Also tried to move gl initialization to working thread, got crash on glfwInit (ReferenceError: window is not defined). Next, I removed threading from code and compiled it with GLFWwindow* w;
void mainLoopIteration(void*)
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(w);
}
int main()
{
std::cout << "TSS: " << emscripten_has_threading_support() << std::endl;
if (glfwInit() != GLFW_TRUE) {
std::cout << "No glfw" << std::endl;
return 2;
}
w = glfwCreateWindow(100, 100, "Foo", 0, 0);
if (glewInit() != GLEW_OK) {
std::cout << "No glew" << std::endl;
return 1;
}
glfwMakeContextCurrent(w);
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
emscripten_set_main_loop_arg(mainLoopIteration, nullptr, 0, 1);
return 0;
} Got black viewport. Removing |
Replaced Probably |
Consider the following example:
It worked correctly when compiled with sdk 1.38.31. After updating to sdk 1.38.36 it crashes with
I'm compiling the code with
Also tried:
-s OFFSCREENCANVAS_SUPPORT=1
and/or-s USE_WEBGL2=1
with same result.~/.emscripten_cache/
,~/.emscripten
and other sdk artifacts from home directory, reinstalling sdk from scratch. Same result.emcc
instead ofem++
. Same result.Offtopic:
I failed to roll back to 1.38.31, 38.33 and 38.34. Both adding older versions to existing
latest
installation and installing from scratch lead toerror while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
when running emcc. Only reinstalling latest from scratch can fix the problem. What is the proper way to use older versions?What am I missing here?
The text was updated successfully, but these errors were encountered: