-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Feat: add context loss set up to WebGL #10094
Feat: add context loss set up to WebGL #10094
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2124cd4:
|
* make tests reuse the renderer * doc update * fix lint * increase jest --------- Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
I might be wrong, but that doesn't look like a valid code: // Restore the context after this event has exited
setTimeout(() =>
{
if (this.gl.isContextLost() && this.extensions.loseContext)
{
this.extensions.loseContext.restoreContext();
}
}, 0); What I mean specifically is that the function restoreContext() isn't meant to be called in production, it's only for debugging purposes. Which also means that there is no way to restore GPU context on demand, the browser decides about it, not JS application. |
ooops :) You are totally correct! Thankyou for pointing out - let me address that |
fixed here -> https://github.com/pixijs/pixijs/pull/10111/files |
WebGL now loses context without exploding. You won't even notice it happened!
Added test also