Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/library_glemu.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ var LibraryGLEmulation = {


// Add some emulation workarounds
err('WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work.');
console.warning('WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work.');
#if GL_UNSAFE_OPTS == 1
err('WARNING: using emscripten GL emulation unsafe opts. If weirdness happens, try -sGL_UNSAFE_OPTS=0');
console.warning('WARNING: using emscripten GL emulation unsafe opts. If weirdness happens, try -sGL_UNSAFE_OPTS=0');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you see these more than once in you program? We could use the warnOnce helper here maybe?

Copy link
Author

Choose a reason for hiding this comment

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

There are at least 10 such warnings. I'll use the warnOnce.

Copy link
Author

Choose a reason for hiding this comment

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

Hmm, this message shows up for each JS wroker, so I don't think that warnOnce will help here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm.. why is GL being initialized on each worker? Is that intended?

Copy link
Author

Choose a reason for hiding this comment

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

We use the predefined thread pool (-sPTHREAD_POOL_SIZE='navigator.hardwareConcurrency) in order to synchronously spawn threads within our code. I suspect that worker initialization automatically triggers GL init method?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Indeed that seems to be the case. I wonder if we can/should avoid initializing GL on threads that are not using GL (i.e. can we call init() lazily?)

#endif

// XXX some of the capabilities we don't support may lead to incorrect rendering, if we do not emulate them in shaders
Expand Down