-
Notifications
You must be signed in to change notification settings - Fork 17
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
Clearing the pixi texture cache breaks tagged-text #265
Comments
Could you please give me a full example of the code that is breaking?
By the way i recently did some work to improve performance and texture
caching, i think it was released in v3.7 but Id need to check the changelog
to be sure. Can you make sure you're on the latest version?
Thank you!
…On Fri, Jun 24, 2022, 17:20 wmike1987 ***@***.***> wrote:
Calling PIXI_UTILS.destroyTextureCache() seems to break tagged-text.
It's been difficult to troubleshoot in the browser, but it looks like when
the tagged-text module is loaded, a texture gets created and cached, and
this texture is very important. Since the module won't be reloaded until a
page reload, there's no way to recover from having cleared this texture
from the cache.
This is the stacktrace resulting from trying to create a new TaggedText
object after having cleared the pixi texture cache
text.js:1626 Uncaught TypeError: Cannot set properties of null (setting
'width')
at ***@***.***/text/dist/esm/text.js.Text.updateTexture
(text.js:1626:1)
at ***@***.***/text/dist/esm/text.js.Text.updateText
(text.js:1549:1)
at P (pixi-tagged-text.m.js:1:4195)
at pixi-tagged-text.m.js:1:45114
at Array.map ()
at pixi-tagged-text.m.js:1:44777
at Array.flatMap ()
at pixi-tagged-text.m.js:1:46629
at Array.flatMap ()
at pixi-tagged-text.m.js:1:44214
***@***.***/text/dist/esm/text.js.Text.updateTexture @
text.js:1626
***@***.***/text/dist/esm/text.js.Text.updateText @
text.js:1549
P @ pixi-tagged-text.m.js:1
(anonymous) @ pixi-tagged-text.m.js:1
(anonymous) @ pixi-tagged-text.m.js:1
(anonymous) @ pixi-tagged-text.m.js:1
(anonymous) @ pixi-tagged-text.m.js:1
B.update @ pixi-tagged-text.m.js:1
B.updateIfShould @ pixi-tagged-text.m.js:1
B.setText @ pixi-tagged-text.m.js:1
set @ pixi-tagged-text.m.js:1
C @ pixi-tagged-text.m.js:1
—
Reply to this email directly, view it on GitHub
<#265>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCU2DN4NMPNTYOJBCCA43VQZGETANCNFSM5ZZLQRKA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I'm on the latest version, thanks for checking. I tried this in the tagged-text demo and was able to recreate it. In the index.html file, I added a line to the createPixiApp method: function createPixiApp(
id,
width = 600,
height = 600,
backgroundColor = 0x333333
) {
PIXI.settings.RESOLUTION = 2;
const app = new PIXI.Application({ width, height, backgroundColor });
document.getElementById(id).appendChild(app.view);
//*****added this line******
PIXI.utils.destroyTextureCache();
//*****************************
return app;
} After this, the demo fails for the same reason I was seeing in my app. |
I won't be able to work on this for a few days but if you want to try,
here's what is start with.
1. Does this issue happen when j don't use TaggedText but only Pixi.Text or
Pixie.Application? If so, it may be a pixi bug or there may be a good
reason for it.
2. I'd write a unit test that isolates this case so I'll know when I'm
finished. I would try to make it the minimum possible setup that breaks.
3. Which component might be generating a texture that is reused? I'd
probably look at stack traces to find which component is throwing the
error.
…On Sat, Jun 25, 2022, 17:43 wmike1987 ***@***.***> wrote:
I'm on the latest version, thanks for checking.
I tried this in the tagged-text demo and was able to recreate it. In the
*index.html* file, I added a line to the createPixiApp method:
function createPixiApp(
id,
width = 600,
height = 600,
backgroundColor = 0x333333
) {
PIXI.settings.RESOLUTION = 2;
const app = new PIXI.Application({ width, height, backgroundColor });
document.getElementById(id).appendChild(app.view);
//*****added this line******
PIXI.utils.destroyTextureCache();
//*****************************
return app;
}
After this, the demo fails for the same reason I was seeing in my app.
—
Reply to this email directly, view it on GitHub
<#265 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCU2FSY5NFYRIWAX6AA23VQ6RTZANCNFSM5ZZLQRKA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Calling PIXI_UTILS.destroyTextureCache() seems to break tagged-text.
It's been difficult to troubleshoot in the browser, but it looks like when the tagged-text module is loaded, a texture gets created and cached, and this texture is very important. Since the module won't be reloaded until a page reload, there's no way to recover from having cleared this texture from the cache.
This is the stacktrace resulting from trying to create a new TaggedText object after having cleared the pixi texture cache
The text was updated successfully, but these errors were encountered: