Skip to content

Commit

Permalink
docs(viewport): add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maximmaxim345 committed Feb 22, 2025
1 parent 6603c8a commit 7de78e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/viewport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ impl Viewport {
}
}

/// Update the viewport with a new version of the [`ProjectView`].
pub fn update(&mut self, project_view: Arc<ProjectView>) {
self.prev_project_view = Some(std::mem::replace(&mut self.project_view, project_view));
self.project_view_version += 1;
Expand Down
8 changes: 8 additions & 0 deletions crates/viewport/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ pub struct SceneGraph {
update_state_out: OutputPortUntyped,
}

/// Node to allow caching of the last node.
///
/// This node allows the last node of the [`ViewportPipeline`] to be cached, since otherwise
/// the output of that node would be consumed with `compute()`.
#[derive(PartialEq, Debug, Clone)]
struct CloneSceneGraphNode();

Expand Down Expand Up @@ -135,6 +139,10 @@ pub struct ViewportPipeline {
nodes: Vec<ViewportPluginNode>,
}

/// Project aware cache for the Viewport.
///
/// This is a extension of [`ComputationCache`], that allows changes to [`ProjectView`]s, if
/// a node did only access parts of that, that did not change.
#[derive(Default, Debug)]
pub struct ViewportCache {
prev_project_view: Option<Arc<ProjectView>>,
Expand Down

0 comments on commit 7de78e2

Please sign in to comment.