molgfx-render 0.3.2

The render graph, passes and the engine that drives a frame.
Documentation
//! Trajectory compute recording for resident coordinate frames.

use super::GpuScene;
use crate::passes::TrajectoryPass;
use molgfx_gpu::{CommandEncoder, ComputePassDesc, Device};

impl<D: Device> GpuScene<D> {
    /// Records dirty coordinate interpolation into the frame encoder.
    pub(crate) fn record_trajectories(
        &mut self,
        encoder: &mut D::CommandEncoder,
        trajectory: &TrajectoryPass<D>,
        timestamps: Option<molgfx_gpu::TimestampWrites<'_, D>>,
    ) -> bool {
        if !self
            .structures
            .iter()
            .any(super::GpuStructure::trajectory_dirty)
        {
            return false;
        }
        let mut pass = encoder.begin_compute_pass(&ComputePassDesc {
            label: "trajectory interpolation",
            timestamps,
        });
        for structure in &mut self.structures {
            structure.record_trajectory(&mut pass, &trajectory.pipeline);
        }
        true
    }
}