Skip to content

Conversation

@juj
Copy link
Collaborator

@juj juj commented Jun 5, 2020

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.

…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});`;
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Member

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});`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, sgtm then.

@juj juj merged commit e59655c into emscripten-core:master Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants