-
Notifications
You must be signed in to change notification settings - Fork 109
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
Draw function crashing because of undefined texture #521
Comments
Still happens even after the #529 fix. |
Thanks for raising this - in my first glance of this I'd opt for not adding it to the Quad list, however that would also negatively affect the WebGL path by adding extra logic (also I wouldn't call .gc() at the bottom there). A Try/Catch might be a local Canvas impacted only path without introducing anything new to the WebGL side of things. Let me study this a little more. And tagging @erikhaandrikman because I'm going to give him a call about this 😆 |
Spoke to Erik - going to look into adding a if check to bail out and see if there are any negative side effects, per Erik a Try/Catch might be an expensive chain to add for something that gets called so frequently. Drukolia is going to have a look (for some reason I can't tag him here). |
Cannot reproduce this from happening. Tried several ways, always when GC accurs when it goes through the Draw function in the tx and the others are not undefined. |
Issue context:
Version: 2.8.1
Currently when we have our project running in canvas mode we noticed that by reaching the memory pressure limit the stage.gc() is called to free up memory so that the app doesn't crash on the device. But sometimes what can happen is we free up a texture but the draw function is called and crashes here:
/core/src/renderer/c2d/shaders/DefaultShader.mjs
Because at that point the texture doesn't exist. We are able to prevent this by either preventing the texture and element to be added to the CoreQuadList (in CoreRenderState > addQuad) or by preventing from doing the draw function when the texture doesn't exist.
/core/src/tree/core/CoreRenderState.mjs
OR
try / catch on method draw in /core/src/renderer/c2d/shaders/DefaultShader.mjs
We know that this is not an issue for webgl, since the logic for the draw function actually accepts the possibility of the texture being null
The text was updated successfully, but these errors were encountered: