-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
asset server: hot reload of shaders crashes app #5631
Comments
Is it possible that you saved the shader while it was invalid? The only times I've ever seen this was when I saved an invalid shader. Not crashing on invalid shader would be a solution, but I just want to make sure this is what's going on. Also, can you add a license to you repo, we can't look at unlicensed code |
The shader is valid. In the example repo, it basically switches (file copy) between 2 valid shaders until the app crashes.
Added a license. |
I can confirm this issue. When you save your shader, sometimes it just panics with Also noticed the higher the FPS, the higher the chance of this problem happening. Running without VSync, at ~400 fps it happens very often. At lower FPS, it is less likely to happen. |
I've run into this a lot lately, it's pretty annoying. |
It's the "known" issue of Bevy being notified as soon as the file is modified, and trying to load it then before the new content is written to disk. This issue will depend on your OS, your code editor, your filesystem, your disk/ssd, ... |
Perhaps we could fix this by having bevy not immediately reload the content, wait Xms, and then check if it's changed again, and if so keep waiting? |
Yup that should probably work. In this system https://github.com/bevyengine/bevy/blob/main/crates/bevy_asset/src/io/file_asset_io.rs#L177
I never managed to reproduce the issue, but that should work If someone wants to tackle the issue, be sure to be able to reproduce first |
Bevy version
0.8
Relevant system information
Rust 1.62.1
Windows 10
What you did
I tried to modify shaders at runtime and sometimes got the following error:
I've created a repo to simulate the error here:
https://github.com/c-antin/bevy_asset_server_watch_for_changes_shader_bug
The text was updated successfully, but these errors were encountered: