Fix issue with PROXY_TO_PTHREAD and OFFSCREENCANVAS_SUPPORT clashing#8901
Fix issue with PROXY_TO_PTHREAD and OFFSCREENCANVAS_SUPPORT clashing#8901samsinsane wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
- eglCreateContext and eglMakeCurrent no longer proxy to the main thread when using an offscreen canvas
|
Thanks @samsinsane! This seems like a general issue, and maybe there's a better solution I'm not aware of. @juj, should all these proxied methods just be turned off when offscreen canvas is enabled? Perhaps we should do that automatically for all proxied methods in |
No - that goes against the current meaning of these build flags. The meaning of We should not dictate proxying at link time based on The HTML5 API for creating GL contexts works in this way - depending on the context creation flags, proxying is done or skipped. However architecting custom EGL extensions can be more annoying than is worth it, so I'd be open to utilizing a new option #if OFFSCREENCANVAS_SUPPORT != 2
eglCreateContext__proxy: 'sync',
#endifthen one can build with |
|
I believe that I don't recall exactly what happened with |
Hmm, I think the transfer is due to this limitation marked with a TODO: . You are building with-s PROXY_TO_PTHREAD=1 as well?
In that code, Module.canvas will be transferred to Offscreen.
The current problem is that the function Given the current limitation with respect to EGL, I think I would:
|
I'm sorry to be a pain but I'm not really following here. If |
That sounds like a feasible approach. If you want to develop this, it certainly can. It just has not been fixed to do so. There may be more complications, e.g. with |
I already have a workaround in place and I'm in no rush, so I'm happy to work on the proper solution, whatever that happens to be. The only issue is that I'm not entirely sure how to proxy the function manually, it looks like I'd need to add
We don't call the EGL functions directly, they're called via SDL2 and these appeared to be the only two functions that caused issues. |
You can find an example of how manual proxying is done in the implementation of Thinking about this - implementing manual proxying logic independently to library_egl.js would be duplicating all that logic for no good. The best way to proceed would be to make eglCreateContext back on top of the HTML5 PR #5580 is probably the best way to approach this, i.e. rewrite EGL to C/C++ to back on top of HTML5 API, so it gets multithreading support out of the box. If resurrecting #5580 is a bit too much, then another way might be to make |
|
The deletion of the Re-opening and re-targeting to master. |
|
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
|
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Resolves #8852