Skip to content
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

Change log level in library_glemu.js #23083

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mzukovec
Copy link

@mzukovec mzukovec commented Dec 5, 2024

Change the log level from error to warning during GL emulation.

It's a bit annoying since the console log receives a lot of error level messages, which are actually warnings.

Change the log level from error to warning during GL emulation
#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?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants