-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix WebGL emscripten_webgl_get_context_attributes() proxying #11356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…reenCanvas and Offscreen Framebuffer builds. Autogenerate the simplest pattern of proxying mechanism to clean up the code to avoid repeating the proxy boilerplate each time.
| delete funcs[i + '__proxy']; | ||
| var funcArgs = listOfNFunctionArgs(funcs[i]); | ||
| var funcArgsString = funcArgs.join(','); | ||
| var funcBody = `return GL.contexts[p0] ? _${i}_calling_thread(${funcArgsString}) : _${i}_main_thread(${funcArgsString});`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment earlier says this may need to run on the same thread, the main thread, or another pthread. How is the case of another pthread handled? IIUC this line handles the other two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the TODO in this block. It is an existing limitation that has never worked. For a few functions (canvas size setting and getting) I have manually written the pthread->pthread proxying path, it is considerably more complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, sgtm then.
| delete funcs[i + '__proxy']; | ||
| var funcArgs = listOfNFunctionArgs(funcs[i]); | ||
| var funcArgsString = funcArgs.join(','); | ||
| var funcBody = `return GL.contexts[p0] ? _${i}_calling_thread(${funcArgsString}) : _${i}_main_thread(${funcArgsString});`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, sgtm then.
Fix WebGL emscripten_webgl_get_context_attributes() proxying in OffscreenCanvas and Offscreen Framebuffer builds. Autogenerate the simplest pattern of proxying mechanism to clean up the code to avoid repeating the proxy boilerplate each time.