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.
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/emscripten-discuss/1756569678826%40dmwebmail.dmwebmail.chezphil.org.