Skip to content

Add petgraph back to bevy_ecs #18735

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bevy_animation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bevy_platform_support = { path = "../bevy_platform_support", version = "0.16.0-d
] }

# other
petgraph = { version = "0.7", features = ["serde-1"] }
petgraph = { version = "0.8", features = ["serde-1"] }
ron = "0.8"
serde = "1"
blake3 = { version = "1.0" }
Expand Down
3 changes: 3 additions & 0 deletions crates/bevy_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ variadics_please = { version = "1.1", default-features = false }
tracing = { version = "0.1", default-features = false, optional = true }
log = { version = "0.4", default-features = false }
bumpalo = "3"
petgraph = { version = "0.8", default-features = false, features = [
"graphmap",
] }

concurrent-queue = { version = "2.5.0", default-features = false }
[target.'cfg(not(all(target_has_atomic = "8", target_has_atomic = "16", target_has_atomic = "32", target_has_atomic = "64", target_has_atomic = "ptr")))'.dependencies]
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_ecs/src/schedule/auto_insert_apply_deferred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl ScheduleBuildPass for AutoInsertApplyDeferredPass {
.hierarchy()
.graph()
.edges_directed(node, Direction::Incoming)
.any(|(parent, _)| set_has_conditions(graph, parent))
.any(|(parent, _, _)| set_has_conditions(graph, parent))
}

fn system_has_conditions(graph: &ScheduleGraph, node: NodeId) -> bool {
Expand All @@ -96,7 +96,7 @@ impl ScheduleBuildPass for AutoInsertApplyDeferredPass {
.hierarchy()
.graph()
.edges_directed(node, Direction::Incoming)
.any(|(parent, _)| set_has_conditions(graph, parent))
.any(|(parent, _, _)| set_has_conditions(graph, parent))
}

let mut system_has_conditions_cache = HashMap::<usize, bool>::default();
Expand Down Expand Up @@ -201,8 +201,8 @@ impl ScheduleBuildPass for AutoInsertApplyDeferredPass {
.copied()
.unwrap_or_else(|| self.get_sync_point(graph, target_distance));

sync_point_graph.add_edge(*node, sync_point);
sync_point_graph.add_edge(sync_point, target);
sync_point_graph.add_edge(*node, sync_point, ());
sync_point_graph.add_edge(sync_point, target, ());

// The edge without the sync point is now redundant.
sync_point_graph.remove_edge(*node, target);
Expand Down
Loading