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

Materials tab preview generations causes project to hang on save #195

Open
CpazR opened this issue Aug 24, 2024 · 6 comments
Open

Materials tab preview generations causes project to hang on save #195

CpazR opened this issue Aug 24, 2024 · 6 comments

Comments

@CpazR
Copy link

CpazR commented Aug 24, 2024

I have a number of different materials (shaders included) that the material selector tabs likes to re-generate previews for every time it saves. This causes the editor to hang and become unresponsive for upwards of 20 or so seconds when a save is triggered.

This seems to be a new thing because I don't remember it being so bad before. There is a change that the godot 4.3 update did something here.

A good way to test is the have multiple a number of materials (lets say 10) in the materials tabs and save.
Then filter then out (I typed "none" in the filter field, as an example) and saving no longer caused the editor to hang.

There is, of course, the possibility this is an issue with my project, but I'm not doing anything special with my shaders as far as I can tell.

NOTE: The materials tab doesn't need to be open either. This hanging issue was eluding me for a while because I thought it was related to a large asset.

@CpazR
Copy link
Author

CpazR commented Aug 24, 2024

Some video evidence of this issue.
Not quite so dramatic of a hang here. Made a point to trim down on some unused shaders I was experimenting with.
Still demonstrates the issue:
https://github.com/user-attachments/assets/7c0e379f-77ac-458e-b6b0-36ebd42fc481

@blackears
Copy link
Owner

blackears commented Aug 24, 2024

I made a change to how the thumbnails are being generated in 1.0.4. Now it's using a Godot library routine to generate the thumbnails. It might be faster to switch back to the old method where I was generating them in a separate viewport, although I don't know if that will be faster or not.

Edit:
I've not noticed much slowdown on my development machine - could something other than thumbnail generation possibly be causing this?

@CpazR
Copy link
Author

CpazR commented Aug 25, 2024

I made a change to how the thumbnails are being generated in 1.0.4. Now it's using a Godot library routine to generate the thumbnails. It might be faster to switch back to the old method where I was generating them in a separate viewport, although I don't know if that will be faster or not.

Edit: I've not noticed much slowdown on my development machine - could something other than thumbnail generation possibly be causing this?

I was trying to find what else would have caused, but I narrowed it down to shaders. Then I saw the material tab and toyed around with that.

Maybe the process works different depending on hardware??? My main machine isn't a slouch, but maybe there's some inconsistencies there.

@CpazR
Copy link
Author

CpazR commented Aug 25, 2024

Also feel it's worth asking, does it need to generate previews every time? Can't it cache the previews and only re-generate them when the material or shader in question is "dirty"?

Would mean not all previews are generated at once and only re-generated when they need to be.

@blackears
Copy link
Owner

The issue there is that I don't know when the shaders become dirty. They are resources managed outside of Cyclops and I don't think there is a way to be notified of them changing.

Do you still get the slowdown when the materials tab is not open? You could just not have the window open a s a workaround.

I don't know when I'll get enough time to work on this. I'm a bit pressed at the moment.

@CpazR
Copy link
Author

CpazR commented Aug 30, 2024

OK. Little bit of a write-up after being able to spend more time looking into this.

Still don't have the full picture, though. Will defer to you if this should be closed.

The issue there is that I don't know when the sharers become dirty. They are resources managed outside of Cyclops and I don't think there is a way to be notified of them changing.

Understandable. But also a little surprising that plugins wouldn't be able to access that.

Do you still get the slowdown when the materials tab is not open? You could just not have the window open a s a workaround.

The reason this took as long to identify as it did was due to the fact this happened even with the material tab closed.

So, I was able to experiment a little more with this once I carved out some time.
I think this is a compounding issue between multiple plugins. Maybe an issue with godot itself and how it manages plugins that read assets from the file system.
I think the main culprit is somewhere in AssetDock. With the hanging stopping (or at least being significantly reduced down to a split second) once I disabled that addon. But it does seem to be worsened with the shader preview generation that cyclops does.

Hence my suspicion this is an issue with godot itself. But I don't know how the editor manages plugins to really be able to validate those suspicions.

I don't know when I'll get enough time to work on this. I'm a bit pressed at the moment.

Yeah, I wouldn't worry so much about this. Maybe see if you can replicate the hanging on your side? I'm curious how reproducible this is.

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

No branches or pull requests

2 participants