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

WEBGL_lose_context.restoreContext is used for restoring context #7232

Closed
SmiVan opened this issue Feb 6, 2021 · 15 comments · Fixed by #8835
Closed

WEBGL_lose_context.restoreContext is used for restoring context #7232

SmiVan opened this issue Feb 6, 2021 · 15 comments · Fixed by #8835
Labels
💰Bounty Bounty of any size 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. $50 Medium bug or feature bounty. Something that might take 1-2 hours to address. $200 Super large bug or feature bounty. Something that might take a week to address.

Comments

@SmiVan
Copy link

SmiVan commented Feb 6, 2021

https://github.com/pixijs/pixi.js/blob/78516ba04f3fb59f4de06bd0dee5a609d9f91c19/packages/core/src/context/ContextSystem.ts#L98-L102

I'm fairly certain that (WEBGL_lose_context).restoreContext() is not intended to be used to recover from a general loss of context situation, it rather seems to be intended for recovering from (WEBGL_lose_context).loseContext() for debugging purposes.

See the specification and the following discussion on StackOverflow.

This is probably directly related to #7206, where it can be seen that the system can't actually handle real context loss, just a simulated one.

@ShukantPal
Copy link
Member

This does seem to be a bug @GoodBoyDigital

@ShukantPal ShukantPal added the 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. label Feb 8, 2021
@bigtimebuddy
Copy link
Member

I think our context loss/restore really needs some help.

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Jun 2, 2021
@SmiVan
Copy link
Author

SmiVan commented Jun 4, 2021

This remains an issue in the current master branch, it should not be closed.

@stale stale bot removed the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Jun 4, 2021
@stale
Copy link

stale bot commented Sep 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Sep 6, 2021
@rj3d
Copy link

rj3d commented Feb 16, 2022

This is still an issue in the current master branch and should not be closed.

I didn't get around to commenting on #7206 before it was closed by stalebot, but we still have that issue in 6.2.0. Currently, we restart the application in the event of a WebGL context loss to get around the sprites not rendering.

In our testing of recovery methods, we were able to get things to recover and render properly after a WebGL context loss by listening for a context loss and then recreating all of the graphics objects and sprites. We ended up not using this recover method this as it would eventually fail if there were multiple context losses in the same session. In the event of successive context losses pretty much everything would stop rendering regardless of when or how it was created.

@stale stale bot removed the Stale Previously “Won’t Fix”, bots should tag with this for inactive issues or pull-requests. label Feb 16, 2022
@naiteluo
Copy link

naiteluo commented Mar 4, 2022

Any progress about this? Just want to know the proper way to handle context lost situation, otherwise than recreating the whole applicaiton instances.

@bigtimebuddy
Copy link
Member

I'm going to put a bounty on this if someone wants to take a stab at working on this.

@bigtimebuddy bigtimebuddy added $50 Medium bug or feature bounty. Something that might take 1-2 hours to address. 💰Bounty Bounty of any size labels Mar 4, 2022
@ShukantPal
Copy link
Member

Screen Shot 2022-04-02 at 1 35 32 PM

I think the right solution here is for PixiJS to clear all of its internal state and wait for the webglcontextrestored event? wdyt @bigtimebuddy

@ShukantPal
Copy link
Member

@bigtimebuddy @Altimor has asked for the bounty to be raised to $500 on behalf of @teamflowhq − how can we pay for this bounty?

@bigtimebuddy
Copy link
Member

Please see https://github.com/pixijs/pixijs/wiki/Bounties for details. Basically, a donation to our Open Collective to cover the bounty. I'll remove the current bounty amount.

@bigtimebuddy bigtimebuddy removed the $50 Medium bug or feature bounty. Something that might take 1-2 hours to address. label Sep 5, 2022
@ShukantPal
Copy link
Member

Thanks @bigtimebuddy. Please see contribution #571998 in the OpenCollective for a bounty of $250!

@bigtimebuddy bigtimebuddy added $200 Super large bug or feature bounty. Something that might take a week to address. $50 Medium bug or feature bounty. Something that might take 1-2 hours to address. labels Sep 12, 2022
@RoboVij
Copy link

RoboVij commented Nov 7, 2022

Is it fixed? If yes, is it available only on the latest version and we need to upgrade or is it also available on v5 (we're using 5.3.11)? Because there are some breaking changes while migrating and I'm not familiar with pixi. A previous developer did all the coding.

@bigtimebuddy
Copy link
Member

This bounty has not been claimed or fixed yet.

@RoboVij
Copy link

RoboVij commented Nov 7, 2022

Ok. Our website has several menu tabs. Two of them use the pixi based component. When switching to normal tabs from pixi-using tab, it's all fine. But when we switch back to pixi-using tab the crash and context loss happens. Is there a way to destroy the context when leaving the pixi-using tab so that when we come back it doesn't crash? Or is it not possible and that's what this issue is referring to?

@bigtimebuddy bigtimebuddy linked a pull request Nov 11, 2022 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💰Bounty Bounty of any size 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. $50 Medium bug or feature bounty. Something that might take 1-2 hours to address. $200 Super large bug or feature bounty. Something that might take a week to address.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants