Skip to content

Commit

Permalink
keep track of type name in NodeState (#1444)
Browse files Browse the repository at this point in the history
Adds the original type_name to `NodeState`, enabling plugins like [this](https://github.com/jakobhellermann/bevy_mod_debugdump).
This does increase the `NodeState` type by 16 bytes, but it is already 176 so it's not that big of an increase.
  • Loading branch information
jakobhellermann committed Feb 22, 2021
1 parent a1ec684 commit bc4fe9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_render/src/render_graph/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ impl Edges {
pub struct NodeState {
pub id: NodeId,
pub name: Option<Cow<'static, str>>,
pub type_name: &'static str,
pub node: Box<dyn Node>,
pub input_slots: ResourceSlots,
pub output_slots: ResourceSlots,
Expand All @@ -135,6 +136,7 @@ impl NodeState {
input_slots: ResourceSlots::from(node.input()),
output_slots: ResourceSlots::from(node.output()),
node: Box::new(node),
type_name: std::any::type_name::<T>(),
edges: Edges {
id,
input_edges: Vec::new(),
Expand Down

0 comments on commit bc4fe9b

Please sign in to comment.