Phil Endecott
unread,Aug 30, 2025, 12:01:26 PM (9 days ago) Aug 30Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to emscripte...@googlegroups.com
Dear Experts,
I have an OpenGL app which I successfully ported to Emscripten back in 2021.
That port was single-threaded.
I'm now trying to make it work with multiple threads. This mostly
works, but I
have an issue with the OpenGL code.
I only do OpenGL drawing on the main thread, but I do have background threads
that create OpenGL textures. They compute the texture content on the
CPU, then
call glTexSubImage2D or similar to load the content into a texture.
On other platforms - e.g. iOS and EGL on Linux - it is possible to create
multiple OpenGL contexts that share the same set of textures - for example,
the share_context parameter to eglCreateContext(). But I don't see a way
to do this with the WebGL APIs, or their Emscripten wrappers. (The
emscripten implementation of eglCreateContext names the share_context
parameter "hmm"!).
Has anyone else addressed this? Is this a fundamental limitation of the
WebGL + OffscreenCanvas APIs? If so, I guess I need to prepare my
texture data on a background thread and then proxy to the main thread
to actually create the texture.
Thanks,
Phil.