Skip to content

Commit f41a28a

Browse files
committed
Add explicit GL dependency to library_html5_webgl
The dependency wrangling here was a workaround for a problem that was solved in #16405 (see the command that is being deleted). Pretty much all the functions in this depend either directly or indirectly on the global GL object, so it makes sense to use autoAddDeps rather than try to add individual deps.
1 parent 7c3be8e commit f41a28a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/library_html5_webgl.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,7 @@ var LibraryHtml5WebGL = {
7171
emscripten_webgl_commit_frame: 'emscripten_webgl_do_commit_frame',
7272
#endif
7373

74-
// This code is called from emscripten_webgl_create_context() and proxied
75-
// to the main thread when in offscreen framebuffer mode. This won't be
76-
// called if GL is not linked in, but also make sure to not add a dep on
77-
// GL unnecessarily from here, as that would cause a linker error.
7874
emscripten_webgl_do_create_context__deps: [
79-
#if LibraryManager.has('library_webgl.js')
80-
'$GL',
81-
#endif
8275
#if USE_PTHREADS && OFFSCREEN_FRAMEBUFFER
8376
'emscripten_webgl_create_context_proxied',
8477
#endif
@@ -641,6 +634,10 @@ function handleWebGLProxying(funcs) {
641634
}
642635

643636
handleWebGLProxying(LibraryHtml5WebGL);
637+
#endif // USE_PTHREADS
638+
639+
#if LibraryManager.has('library_webgl.js')
640+
autoAddDeps(LibraryHtml5WebGL, '$GL');
644641
#endif
645642

646643
mergeInto(LibraryManager.library, LibraryHtml5WebGL);

0 commit comments

Comments
 (0)