The issue turns out a bit more twisted, I used to query "glReadBuffer", which doesn't exist in GLES2, and wasn't used it my code anyway.
The SDL2 port actually already calls SDL_GL_GetProcAddress => device->GL_GetProcAddress => Emscripten_GLES_GetProcAddress => SDL_EGL_GetProcAddress => _this->egl_data->eglGetProcAddress => _emscripten_GetProcAddress (no less ;)). When this fails, however, SDL then tries SDL_LoadFunction => dlopen. Which I assume used to return NULL, and now raises an exception. Dropping the non-existing function call while still using SDL_GL_GetProcAddress for the rest also solves the issue in my case. This makes SDL_GL_GetProcAddress still work but less forgiving (with a confusing error message). - Beuc On 24/01/2019 16:20, Alon Zakai wrote: > Oh, thanks, I missed that this was for SDL_GL_GetProcAddress getting > GL functions specifically. That should definitely still work. Maybe > what's going on is that the SDL code calls dlopen? Instead, it should > call emscripten_GetProcAddress (impl is in system/lib/gl/gl.c). Looks > like we need to add it to emscripten.h too. Beuc, is that change to > SDL practical? > > On Thu, Jan 24, 2019 at 3:09 AM キャロウ マーク <git...@callow.im > <mailto:git...@callow.im>> wrote: > > > > > On Jan 23, 2019, at 8:35, Alon Zakai <alonza...@gmail.com > <mailto:alonza...@gmail.com>> wrote: > > > > Well, what I think happened is we used to have a very simple > dlopen, and when we rewrote it to be more powerful, we simplified > it to only work on linkable code. So the case of a module loading > symbols from itself is a case that is not well handled, you're > right, it adds overhead there. However, perhaps you can work > around it in the code, avoid using dlopen and get the function > pointers directly? > > > > This change apparently broke SDL_GL_GetProcAddress, the complaint > at the start of this thread. Suggesting workarounds is not > acceptable, except as a strictly temporary measure. The SDL port > needs to be fixed. Given that most Open GL {,ES} applications > dynamically obtain their function pointers, you need to consider > other fixes too. Such as EGLGetProcAddress in the EGL emulation. > > Regards > > -Mark > > -- > You received this message because you are subscribed to the Google > Groups "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to emscripten-discuss+unsubscr...@googlegroups.com > <mailto:emscripten-discuss%2bunsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google > Groups "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to emscripten-discuss+unsubscr...@googlegroups.com > <mailto:emscripten-discuss+unsubscr...@googlegroups.com>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.