Closed
Description
Bevy version
bevy = { version = "0.12.1", features = ["dynamic_linking", "file_watcher", "embedded_watcher"] }
Relevant system information
os: linux
rust: rustc
commit-hash: 5680fa18feaa87f3ff04063800aec256c3d4b4be
commit-date: 2023-08-23
host: x86_64-unknown-linux-gnu
release: 1.72.0
LLVM version: 16.0.5
What you did
Upgrade bevy from 0.11 to 0.12
What went wrong
since 0.12, my game lagging alot (fps drops from 60 to 1).
after short investigation, i found a problem:
pub fn editor_regenerate_chunks_when_params_changed(
mut world: ResMut<WorldResource>,
mut writer: EventWriter<ChunkGeneratedEvent>,
rnd: Res<RandResource>,
props: Res<GenerationResource>,
spline_handles: Res<SplinesResource>,
spline_assets: Res<Assets<SplineAsset>>,
) {
if !(props.is_changed() || rnd.is_changed() || spline_assets.is_changed()) {
return;
}
// slow code, that should execute very rarely
}
In my code i have some resources, that should trigger map re-generation, but only if this resources is changed.
One of this resource is spline_assets: Res<Assets<SplineAsset>>
.
Code in spline_assets.is_changed()
executed as always true
.
I think it's something related to new asset system.